Check the database has been initialized before running the daemon

tags/smeserver-phplist-0.2.1-1
Daniel Berteaud 10 years ago
parent 37a9f13e4a
commit e62ef77c82
  1. 10
      root/var/service/phplist/run

@ -2,8 +2,16 @@
exec 2>&1
cd /usr/share/phplist/bin
# Check if database is initialized
DB=$(/sbin/e-smith/db configuration getprop phplist DbName || echo phplist)
/usr/bin/mysql $DB -e "SELECT value FROM phplist_config WHERE item='version';" >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "PHPList database not initialized yet"
sv d .
exit 0
fi
cd /usr/share/phplist/bin
while true; do
/usr/local/bin/setuidgid www ./phplist -pprocessbounces
/usr/local/bin/setuidgid www ./phplist -pprocessqueue

Loading…
Cancel
Save