mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-12-28 09:40:47 +08:00
make the datadirectory more robust
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
de61270ac3
commit
513e389a24
2 changed files with 7 additions and 1 deletions
|
@ -10,6 +10,9 @@ print_green() {
|
|||
if ! [ -a "/var/run/docker.sock" ]; then
|
||||
echo "Docker socket is not available. Cannot continue."
|
||||
exit 1
|
||||
elif ! mountpoint -q "/mnt/docker-aio-config"; then
|
||||
echo "/mnt/docker-aio-config is not a mountpoint. Cannot proceed!"
|
||||
exit 1
|
||||
elif ! sudo -u www-data test -r /var/run/docker.sock; then
|
||||
echo "Trying to fix docker.sock permissions internally..."
|
||||
GROUP="$(stat -c '%g' /var/run/docker.sock)"
|
||||
|
|
|
@ -193,9 +193,12 @@ class ConfigurationManager
|
|||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidSettingConfigurationException
|
||||
*/
|
||||
public function WriteConfig(array $config) : void {
|
||||
if(!is_dir(DataConst::GetDataDirectory())) {
|
||||
mkdir(DataConst::GetDataDirectory());
|
||||
throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not exist! Something was set up falsely!");
|
||||
}
|
||||
file_put_contents(DataConst::GetConfigFile(), json_encode($config));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue