From bd76d03750b7a6868fc3b1e69f66443c792e5892 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Mon, 24 Aug 2015 15:28:31 -0400 Subject: [PATCH] add init script --- gyro.init | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 gyro.init diff --git a/gyro.init b/gyro.init new file mode 100755 index 0000000..08713cb --- /dev/null +++ b/gyro.init @@ -0,0 +1,34 @@ +#! /bin/sh +# /etc/init.d/gyro + +### BEGIN INIT INFO +# Provides: gyro +# Required-Start: $network $local_fs +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: The Salt Mines Gyro Button Service +# Description: https://github.com/TheSaltMines/gyro-button +### END INIT INFO + +# If you want a command to always run, put it here + +# Carry out specific functions when asked to by the system +case "$1" in + start) + echo "Starting gyro" + # run application you want to start + /usr/local/bin/gyro wlan0 >>/var/log/gyro 2>&1 & + ;; + stop) + echo "Stopping gyro" + # kill application you want to stop + killall gyro + ;; + *) + echo "Usage: /etc/init.d/gyro {start|stop}" + exit 1 + ;; +esac + +exit 0