Skip to content

Instantly share code, notes, and snippets.

@dbonates
Last active September 23, 2019 02:21
Show Gist options
  • Select an option

  • Save dbonates/fd6cf3312e8b9609e5b02e4bbac8dbf0 to your computer and use it in GitHub Desktop.

Select an option

Save dbonates/fd6cf3312e8b9609e5b02e4bbac8dbf0 to your computer and use it in GitHub Desktop.
retrogame startup script
#!/bin/sh
PIDFILE=/var/run/retrogame.pid
NAME="S32retrogame"
RUN_AS=root
CMD=/usr/bin/retrogame
do_start() {
# "... Starting : retrogame gpio-remapper"
start-stop-daemon --start --background --user $RUN_AS --pidfile $PIDFILE --make-pidfile --chuid $RUN_AS --startas $CMD
}
do_stop() {
start-stop-daemon --stop --pidfile $PIDFILE
}
case "$1" in
start)
# "Starting $NAME"
do_start
;;
stop)
# "Stopping $NAME"
do_stop
;;
restart)
# "Restarting $NAME"
do_stop
do_start
;;
*)
echo "Usage: /etc/init.d/S32retrogame {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