mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 17:37:02 +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
|
SNAPPYMAIL_CONFIG_FILE=/var/lib/snappymail/_data_/_default_/configs/application.ini
|
||||||
if [ ! -f "$SNAPPYMAIL_CONFIG_FILE" ]; then
|
if [ ! -f "$SNAPPYMAIL_CONFIG_FILE" ]; then
|
||||||
echo "[INFO] Creating default Snappymail configuration: $SNAPPYMAIL_CONFIG_FILE"
|
echo "[INFO] Creating default Snappymail configuration: $SNAPPYMAIL_CONFIG_FILE"
|
||||||
# Run snappymail and exit. This populates the snappymail data directory
|
# Run snappymail and exit. This populates the snappymail data directory and generates the config file
|
||||||
su - www-data -s /bin/sh -c 'php /snappymail/index.php' > /dev/null
|
# 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
|
fi
|
||||||
|
|
||||||
echo "[INFO] Overriding values in snappymail configuration: $SNAPPYMAIL_CONFIG_FILE"
|
echo "[INFO] Overriding values in snappymail configuration: $SNAPPYMAIL_CONFIG_FILE"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue