Allow some uptime before reporting gnusocial/postactiv daemon restart
This commit is contained in:
parent
924577a6f2
commit
1b349bbd53
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue