Skip to content

Instantly share code, notes, and snippets.

@bkrepo
Created February 20, 2017 02:38
Show Gist options
  • Save bkrepo/8fd6add5beda874bea4f6c270673be66 to your computer and use it in GitHub Desktop.
Save bkrepo/8fd6add5beda874bea4f6c270673be66 to your computer and use it in GitHub Desktop.
/etc/init.d/gpio_keyd
#! /bin/sh
### BEGIN INIT INFO
# Provides: gpio_keyd
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Run /usr/bin/gpio_keyd if it exist
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
do_start() {
if [ -x /usr/bin/gpio_keyd ]; then
/usr/bin/gpio_keyd -d
ES=$?
[ "$VERBOSE" != no ] && log_end_msg $ES
return $ES
fi
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
killall gpio_keyd
exit 0
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment