mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 01:17:04 +03:00
Print php exception when snappymail fails to generate data directory and config file on the very first time
This commit is contained in:
parent
d6143d3c36
commit
e320c546fd
1 changed files with 8 additions and 2 deletions
|
|
@ -33,8 +33,14 @@ find /var/lib/snappymail/ -type d -exec chmod 750 {} \;
|
|||
SNAPPYMAIL_CONFIG_FILE=/var/lib/snappymail/_data_/_default_/configs/application.ini
|
||||
if [ ! -f "$SNAPPYMAIL_CONFIG_FILE" ]; then
|
||||
echo "[INFO] Creating default Snappymail configuration: $SNAPPYMAIL_CONFIG_FILE"
|
||||
# Run snappymail and exit. This populates the snappymail data directory
|
||||
su - www-data -s /bin/sh -c 'php /snappymail/index.php' > /dev/null
|
||||
# Run snappymail and exit. This populates the snappymail data directory and generates the config file
|
||||
# On error, print php exception and exit
|
||||
EXITCODE=
|
||||
su - www-data -s /bin/sh -c 'php /snappymail/index.php' > /tmp/out || EXITCODE=$?
|
||||
if [ -n "$EXITCODE" ]; then
|
||||
cat /tmp/out
|
||||
exit "$EXITCODE"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[INFO] Overriding values in snappymail configuration: $SNAPPYMAIL_CONFIG_FILE"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue