Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Source function library |
| 4 | . /etc/init.d/functions |
| 5 | |
| 6 | NAME=tee-supplicant |
| 7 | PATH=/sbin:/bin:/usr/sbin:/usr/bin |
| 8 | DESC="OP-TEE Supplicant" |
| 9 | |
| 10 | DAEMON=@sbindir@/$NAME |
| 11 | |
| 12 | test -f $DAEMON || exit 0 |
| 13 | |
| 14 | test -f @sysconfdir@/default/$NAME && . @sysconfdir@/default/$NAME |
| 15 | test -f @sysconfdir@/default/rcS && . @sysconfdir@/default/rcS |
| 16 | |
| 17 | SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- -d $OPTARGS" |
| 18 | |
| 19 | set -e |
| 20 | |
| 21 | case $1 in |
| 22 | start) |
| 23 | echo -n "Starting $DESC: " |
| 24 | start-stop-daemon --start $SSD_OPTIONS |
| 25 | echo "${DAEMON##*/}." |
| 26 | ;; |
| 27 | stop) |
| 28 | echo -n "Stopping $DESC: " |
| 29 | start-stop-daemon --stop $SSD_OPTIONS |
| 30 | echo "${DAEMON##*/}." |
| 31 | ;; |
| 32 | restart|force-reload) |
| 33 | $0 stop |
| 34 | sleep 1 |
| 35 | $0 start |
| 36 | ;; |
| 37 | status) |
| 38 | status ${DAEMON} || exit $? |
| 39 | ;; |
| 40 | *) |
| 41 | echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2 |
| 42 | exit 1 |
| 43 | ;; |
| 44 | esac |
| 45 | |
| 46 | exit 0 |