Highest priority: the pre set STORAGE_ROOT/USER, midmost priority: the config settings, lowest priority: the default one.

Dieser Commit ist enthalten in:
H8H
2015-02-01 19:10:23 +01:00
Ursprung a811e58a93
Commit 794a52d042
+9 -4
Datei anzeigen
@@ -93,8 +93,13 @@ fi
# #
# If the config file exists: # If the config file exists:
# Apply the existing configuration options for STORAGE_USER/ROOT # Apply the existing configuration options for STORAGE_USER/ROOT
STORAGE_USER=$([[ -z "$DEFAULT_STORAGE_USER" ]] && echo "user-data" || echo "$DEFAULT_STORAGE_USER") if [ -z "$STORAGE_USER" ]; then
STORAGE_ROOT=$([[ -z "$DEFAULT_STORAGE_ROOT" ]] && echo "/home/$STORAGE_USER" || echo "$DEFAULT_STORAGE_ROOT") STORAGE_USER=$([[ -z "$DEFAULT_STORAGE_USER" ]] && echo "user-data" || echo "$DEFAULT_STORAGE_USER")
fi
if [ -z "$STORAGE_ROOT" ]; then
STORAGE_ROOT=$([[ -z "$DEFAULT_STORAGE_ROOT" ]] && echo "/home/$STORAGE_USER" || echo "$DEFAULT_STORAGE_ROOT")
fi
# Create the STORAGE_USER if it not exists # Create the STORAGE_USER if it not exists
if [ ! $(id -u $STORAGE_USER >/dev/null 2>&1;) ]; then if [ ! $(id -u $STORAGE_USER >/dev/null 2>&1;) ]; then
@@ -104,10 +109,10 @@ fi
# Create the STORAGE_ROOT if it not exists # Create the STORAGE_ROOT if it not exists
if [ ! -d $STORAGE_ROOT ]; then if [ ! -d $STORAGE_ROOT ]; then
mkdir -p $STORAGE_ROOT mkdir -p $STORAGE_ROOT
echo $(setup/migrate.py --current) > $STORAGE_ROOT/mailinabox.version
chown $STORAGE_USER.$STORAGE_USER $STORAGE_ROOT/mailinabox.version
fi fi
echo $(setup/migrate.py --current) > $STORAGE_ROOT/mailinabox.version
chown $STORAGE_USER.$STORAGE_USER $STORAGE_ROOT/mailinabox.version
# Save the global options in /etc/mailinabox.conf so that standalone # Save the global options in /etc/mailinabox.conf so that standalone
# tools know where to look for data. # tools know where to look for data.