xf.li | 8611891 | 2025-03-19 20:07:27 -0700 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Run the daemon |
| 4 | # |
| 5 | |
| 6 | DAEMON="lynq-atcid" |
| 7 | PIDFILE="/var/run/$DAEMON.pid" |
| 8 | EXEC="/usr/bin/lynq-atcid" |
| 9 | EXEC_ARGS="" |
| 10 | |
| 11 | |
| 12 | start() { |
| 13 | echo -n "Starting $DAEMON... " |
| 14 | start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $EXEC_ARGS |
| 15 | [ $? -eq 0 ] && echo "OK" || echo "ERROR" |
| 16 | } |
| 17 | |
| 18 | stop() { |
| 19 | echo -n "Stopping $DAEMON... " |
| 20 | start-stop-daemon -K -p $PIDFILE |
| 21 | [ $? -eq 0 ] && echo "OK" || echo "ERROR" |
| 22 | } |
| 23 | |
| 24 | restart() { |
| 25 | stop |
| 26 | start |
| 27 | } |
| 28 | |
| 29 | case "$1" in |
| 30 | start|stop|restart) |
| 31 | "$1" |
| 32 | ;; |
| 33 | *) |
| 34 | echo "Usage: $0 {start|stop|restart}" |
| 35 | exit 1 |
| 36 | esac |
| 37 | |
| 38 | exit $? |
| 39 | |