mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-02 13:04:42 +01:00
4cbe864454
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
24 lines
848 B
Bash
24 lines
848 B
Bash
#!/bin/sh
|
|
|
|
# rc.triggerhappy, sysv-style init script for triggerhappy.
|
|
# part of the slackbuilds.org triggerhappy build.
|
|
|
|
THD_SOCKET=/var/run/thd.socket
|
|
THD_ARGS="--daemon --user nobody --socket $THD_SOCKET --triggers /etc/triggerhappy/triggers.d/ /dev/input/event*"
|
|
|
|
case "$1" in
|
|
""|"start") if [ -e $THD_SOCKET ]; then
|
|
echo "$0: $THD_SOCKET already exists (daemon running or stale socket?)"
|
|
exit 1;
|
|
fi
|
|
echo "Starting triggerhappy daemon (thd)"
|
|
/usr/sbin/thd $THD_ARGS ;;
|
|
stop) echo "Stopping triggerhappy daemon (thd)"
|
|
/usr/sbin/th-cmd --socket $THD_SOCKET --quit
|
|
/bin/rm -f $THD_SOCKET ;;
|
|
restart) $0 stop ; /bin/sleep 1; exec $0 start ;;
|
|
*) echo "Usage: $0 [stop|start|restart]"
|
|
exit 1 ;;
|
|
esac
|
|
|
|
exit 0
|