Skip to content

Commit

Permalink
add init script
Browse files Browse the repository at this point in the history
  • Loading branch information
joeshaw authored and Joe Shaw committed Aug 24, 2015
1 parent 2b94ac6 commit bd76d03
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions gyro.init
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bd76d03

Please sign in to comment.