Last active
September 23, 2019 02:21
-
-
Save dbonates/fd6cf3312e8b9609e5b02e4bbac8dbf0 to your computer and use it in GitHub Desktop.
retrogame startup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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