Skip to content

Instantly share code, notes, and snippets.

@fgbreel
Created November 7, 2013 18:12
Show Gist options
  • Save fgbreel/7359248 to your computer and use it in GitHub Desktop.
Save fgbreel/7359248 to your computer and use it in GitHub Desktop.
Start/Stop template
#!/bin/bash
### BEGIN INIT INFO
# Provides: fucking
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the fucking daemon
# Description: starts fucking daemon using start-stop-daemon
### END INIT INFO
source /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting Fucking daemon" "fucking"
# start command
log_end_msg $?
;;
stop)
log_daemon_msg "Stoping Fucking daemon" "fucking"
# stop command
log_end_msg $?
;;
restart)
log_daemon_msg "Restarting Fucking daemon" "fucking"
$0 stop
$0 start
;;
*) log_action_msg "Usage: /etc/init.d/fucking {start|stop|restart}"
exit 2
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment