gluon-respondd 636 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh /etc/rc.common
  2. EXTRA_COMMANDS='restart_if_running'
  3. START=50
  4. SERVICE_WRITE_PID=1
  5. SERVICE_DAEMONIZE=1
  6. DEVLIST=/var/run/gluon-respondd.devs
  7. DAEMON=/usr/bin/respondd
  8. LOCK=/var/run/gluon-respondd.lock
  9. do_start() {
  10. DEVS=$(cat $DEVLIST 2>/dev/null | while read dev iface; do echo -n " -i $dev"; done)
  11. service_start $DAEMON -g ff02::2:1001 -p 1001 -d /lib/gluon/respondd $DEVS
  12. }
  13. do_stop() {
  14. service_stop $DAEMON
  15. }
  16. start() {
  17. lock $LOCK
  18. do_start
  19. lock -u $LOCK
  20. }
  21. stop() {
  22. lock $LOCK
  23. do_stop
  24. lock -u $LOCK
  25. }
  26. restart_if_running() {
  27. lock $LOCK
  28. if service_check $DAEMON; then
  29. do_stop
  30. do_start
  31. fi
  32. lock -u $LOCK
  33. }