Skip to content

Instantly share code, notes, and snippets.

@mrdaemon
Created August 23, 2014 05:42
Show Gist options
  • Save mrdaemon/3f00df984bd7207fea3f to your computer and use it in GitHub Desktop.
Save mrdaemon/3f00df984bd7207fea3f to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# HI CHANGE ME PLZ
SMOKEPING=/opt/smokeping/smokeping.fcgi
USER=www-data
PIDFILE=/var/run/smokeping-fcgid.pid
SOCKETF=/var/run/smokeping-fcgid.sock
# I'm sorry this is super barebones
# Feel free to move shit to functions and implement cool shit
# like restart or whatever.
case "$1" in
start)
/usr/bin/spawn-fcgi -s "$SOCKETF" -P "$PIDFILE" -u "$USER" -f "$SMOKEPING"
;;
stop)
kill $(cat $PIDFILE)
;;
*)
echo "Usage: $0 [start|stop]"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment