Skip to content

Instantly share code, notes, and snippets.

@alexalouit
Last active February 19, 2018 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexalouit/4726ece6784b4f142194 to your computer and use it in GitHub Desktop.
Save alexalouit/4726ece6784b4f142194 to your computer and use it in GitHub Desktop.
ISPConfig survey lock file (semaphore)
#!/bin/bash
#
# cron ex: */30 * * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/survey-semaphore-ispconfig.sh >> /root/scripts/cron.log
email=""
# file exist?
if [ -f /usr/local/ispconfig/server/temp/.ispconfig_lock ]
then
# have a correct ttl?
if [ $(find /usr/local/ispconfig/server/temp/.ispconfig_lock -type f -cmin +900) ]
then
# send alert
echo -e "Erreur du semaphore ISPConfig sur le serveur:\n $(hostname)" | mail -s "Rapport d'erreur ISPConfig" $email
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment