mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-29 04:17:07 +00:00
Highest priority: the pre set STORAGE_ROOT/USER, midmost priority: the config settings, lowest priority: the default one.
This commit is contained in:
parent
a811e58a93
commit
794a52d042
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user