Allow some uptime before reporting gnusocial/postactiv daemon restart

This commit is contained in:
Bob Mottram 2018-05-13 10:14:13 +01:00
parent 924577a6f2
commit 1b349bbd53
1 changed files with 6 additions and 3 deletions

View File

@ -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';