Skip to content

Instantly share code, notes, and snippets.

@abohmeed
Last active January 21, 2026 16:27
Show Gist options
  • Select an option

  • Save abohmeed/48328a413cc76eea2a98cca4e25259ab to your computer and use it in GitHub Desktop.

Select an option

Save abohmeed/48328a413cc76eea2a98cca4e25259ab to your computer and use it in GitHub Desktop.
#!/bin/bash
# /etc/init.d/myservice
case "$1" in
start)
echo "Starting myservice"
/usr/bin/myservice &
;;
stop)
echo "Stopping myservice"
killall myservice
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment