S30optee 838 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. DAEMON="tee-supplicant"
  3. PIDFILE="/var/run/$DAEMON.pid"
  4. DAEMON_ARGS="-d /dev/teepriv0"
  5. start() {
  6. printf 'Starting %s: ' "$DAEMON"
  7. start-stop-daemon -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
  8. -- $DAEMON_ARGS
  9. status=$?
  10. if [ "$status" -eq 0 ]; then
  11. echo "OK"
  12. else
  13. echo "FAIL"
  14. fi
  15. return "$status"
  16. }
  17. stop() {
  18. printf 'Stopping %s: ' "$DAEMON"
  19. start-stop-daemon -K -q -p "$PIDFILE"
  20. status=$?
  21. if [ "$status" -eq 0 ]; then
  22. echo "OK"
  23. else
  24. echo "FAIL"
  25. fi
  26. return "$status"
  27. }
  28. restart() {
  29. stop
  30. sleep 1
  31. start
  32. }
  33. case "$1" in
  34. start|stop|restart)
  35. "$1";;
  36. reload)
  37. # Restart, since there is no true "reload" feature (does not
  38. # reconfigure/restart on SIGHUP, just closes all open files).
  39. restart;;
  40. *)
  41. echo "Usage: $0 {start|stop|restart|reload}"
  42. exit 1
  43. esac