init.d script for debian


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/bin/sh
  2. # pavietnam IP update client
  3. # update IP for vietnam1.net
  4.  
  5. SCRIPT=/usr/local/bin/padyn.py
  6. PIDFILE=/var/run/padyn.pid
  7. SSD=/sbin/start-stop-daemon
  8.  
  9. case "$1" in
  10. start)
  11. echo -n "Starting Daemon: "
  12.  
  13. if $SSD --stop --quiet --pidfile $PIDFILE --signal 0
  14. then
  15. echo "already running"
  16. exit
  17. fi
  18.  
  19. $SSD --start --background --make-pidfile --pidfile $PIDFILE --exec $SCRIPT
  20. echo "done."
  21. ;;
  22. stop)
  23. echo -n "Stopping Daemon: "
  24. $SSD --stop --pidfile $PIDFILE
  25. rm -f $PIDFILE
  26. echo "done."
  27. ;;
  28.  
  29. *)
  30. echo "Usage: $0 { start | stop }"
  31. ;;
  32. esac
  33. exit 0

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.