b1c4c18766
Fix issues reported by utils/check-package: package/optee-client/S30optee:40: should be indented with tabs (http://nightly.buildroot.org/#adding-packages-start-script) package/optee-client/S30optee:46: should be indented with tabs (http://nightly.buildroot.org/#adding-packages-start-script) package/optee-client/S30optee:47: should be indented with tabs (http://nightly.buildroot.org/#adding-packages-start-script) package/optee-client/S30optee:48: should be indented with tabs (http://nightly.buildroot.org/#adding-packages-start-script) package/optee-client/S30optee:0: filename should be S<number><number><daemon name> (http://nightly.buildroot.org/#adding-packages-start-script) package/optee-client/S30tee-supplicant:0: run 'shellcheck' and fix the warnings Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> [yann.morin.1998@free.fr: - fix shellcheck SC2086 - rename the file ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
51 lines
854 B
Bash
51 lines
854 B
Bash
#!/bin/sh
|
|
|
|
DAEMON="tee-supplicant"
|
|
PIDFILE="/var/run/$DAEMON.pid"
|
|
|
|
DAEMON_ARGS="-d /dev/teepriv0"
|
|
|
|
start() {
|
|
printf 'Starting %s: ' "$DAEMON"
|
|
# shellcheck disable=SC2086 # we need the word splitting
|
|
start-stop-daemon -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
|
|
-- $DAEMON_ARGS
|
|
status=$?
|
|
if [ "$status" -eq 0 ]; then
|
|
echo "OK"
|
|
else
|
|
echo "FAIL"
|
|
fi
|
|
return "$status"
|
|
}
|
|
|
|
stop() {
|
|
printf 'Stopping %s: ' "$DAEMON"
|
|
start-stop-daemon -K -q -p "$PIDFILE"
|
|
status=$?
|
|
if [ "$status" -eq 0 ]; then
|
|
echo "OK"
|
|
else
|
|
echo "FAIL"
|
|
fi
|
|
return "$status"
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
sleep 1
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start|stop|restart)
|
|
"$1";;
|
|
reload)
|
|
# Restart, since there is no true "reload" feature (does not
|
|
# reconfigure/restart on SIGHUP, just closes all open files).
|
|
restart;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload}"
|
|
exit 1
|
|
esac
|