Make the gnusocial daemon check hourly

This commit is contained in:
Bob Mottram 2016-05-14 19:56:24 +01:00
parent 5a30e23944
commit 9b946e764a
1 changed files with 8 additions and 8 deletions

View File

@ -8440,14 +8440,14 @@ function install_gnu_social {
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs "GNU Social commit" "$MICROBLOG_COMMIT" $MICROBLOG_REPO
# add a script to check that the daemon is running
echo '#!/bin/bash' > /etc/cron.daily/gnusocial-daemons
echo 'daemon_lines=$(ps aux | grep "scripts/queuedaemon.php" | grep "/var/www")' >> /etc/cron.daily/gnusocial-daemons
echo 'if [[ $daemon_lines != *"/var/www/"* ]]; then' >> /etc/cron.daily/gnusocial-daemons
echo " echo \"Restarting GNU Social daemons\" | mail -s \"GNU Social daemons not found\" $MY_EMAIL_ADDRESS" >> /etc/cron.daily/gnusocial-daemons
echo " cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs" >> /etc/cron.daily/gnusocial-daemons
echo ' scripts/startdaemons.sh' >> /etc/cron.daily/gnusocial-daemons
echo 'fi' >> /etc/cron.daily/gnusocial-daemons
chmod +x /etc/cron.daily/gnusocial-daemons
echo '#!/bin/bash' > /etc/cron.hourly/gnusocial-daemons
echo 'daemon_lines=$(ps aux | grep "scripts/queuedaemon.php" | grep "/var/www")' >> /etc/cron.hourly/gnusocial-daemons
echo 'if [[ $daemon_lines != *"/var/www/"* ]]; then' >> /etc/cron.hourly/gnusocial-daemons
echo " echo \"Restarting GNU Social daemons\" | mail -s \"GNU Social daemons not found\" $MY_EMAIL_ADDRESS" >> /etc/cron.hourly/gnusocial-daemons
echo " cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs" >> /etc/cron.hourly/gnusocial-daemons
echo ' scripts/startdaemons.sh' >> /etc/cron.hourly/gnusocial-daemons
echo 'fi' >> /etc/cron.hourly/gnusocial-daemons
chmod +x /etc/cron.hourly/gnusocial-daemons
if grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
return