diff --git a/src/freedombone-utils-gnusocialtools b/src/freedombone-utils-gnusocialtools index 1b7d72a3..73f831ce 100755 --- a/src/freedombone-utils-gnusocialtools +++ b/src/freedombone-utils-gnusocialtools @@ -464,10 +464,13 @@ function gnusocial_hourly_script { echo '/htdocs/scripts/queuedaemon.php" | grep "/var/www")'; echo "cd /var/www/${domain_name}/htdocs"; echo "if [[ \$daemon_lines != *\"/var/www/\"* ]]; then"; - echo " ADMIN_USER=\$(cat $COMPLETION_FILE | grep 'Admin user' | awk -F ':' '{print \$2}')"; - echo " MY_EMAIL_ADDRESS=\$ADMIN_USER@$HOSTNAME"; - echo -n " echo \"Restarting ${gnusocial_type} daemons\" | mail -s \"${gnusocial_type} "; + echo " UPTIME=\$(awk -F '.' '{print \$1}' < \"/proc/uptime\")"; + echo " if [ \"\$UPTIME\" -gt 500 ]; then"; + echo " ADMIN_USER=\$(cat $COMPLETION_FILE | grep 'Admin user' | awk -F ':' '{print \$2}')"; + echo " MY_EMAIL_ADDRESS=\$ADMIN_USER@$HOSTNAME"; + echo -n " echo \"Restarting ${gnusocial_type} daemons\" | mail -s \"${gnusocial_type} "; echo "daemons not found\" \$MY_EMAIL_ADDRESS"; + echo ' fi'; echo ' su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data'; echo 'fi'; echo 'php scripts/delete_orphan_files.php > /dev/null';