blob: 45f35e3a2aafbb88736c2ff83e4ec5a7eb0cf1bc [file] [log] [blame]
xf.li86118912025-03-19 20:07:27 -07001#!/bin/sh
2#
3# Run the daemon
4#
5
6DAEMON="adbd"
7PIDFILE="/var/run/$DAEMON.pid"
8EXEC="/usr/bin/adbd"
9EXEC_ARGS=""
10
11
12start() {
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
18stop() {
19 echo -n "Stopping $DAEMON... "
20 start-stop-daemon -K -p $PIDFILE
21 [ $? -eq 0 ] && echo "OK" || echo "ERROR"
22}
23
24restart() {
25 stop
26 start
27}
28
29case "$1" in
30 start|stop|restart)
31 "$1"
32 ;;
33 *)
34 echo "Usage: $0 {start|stop|restart}"
35 exit 1
36esac
37
38exit $?