Skip to content

Instantly share code, notes, and snippets.

@tareqy
Created May 16, 2015 12:50
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 tareqy/99886170852e31a6139a to your computer and use it in GitHub Desktop.
Save tareqy/99886170852e31a6139a to your computer and use it in GitHub Desktop.
Restarted Beanstalkd if not running, and add to log.
#! /bin/bash
case "$(pidof beanstalkd | wc -w)" in
0) echo "Restarting beanstalkd: $(date)" >> /var/log/beanstalkd.log
/etc/rc.d/init.d/beanstalkd restart
;;
1) # all ok
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment