Skip to content

Instantly share code, notes, and snippets.

@mandhor
Created April 18, 2015 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mandhor/5925d6f918245bdf838a to your computer and use it in GitHub Desktop.
Save mandhor/5925d6f918245bdf838a to your computer and use it in GitHub Desktop.
noip2 init.d
#! /bin/sh
# /etc/init.d/noip2
### BEGIN INIT INFO
# Provides: noip2
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
# . /etc/rc.d/init.d/functions # uncomment/modify for your killproc
DAEMON=/usr/local/bin/noip2
NAME=noip2
test -x $DAEMON || exit 0
case "$1" in
start)
echo -n "Starting dynamic address update: "
start-stop-daemon --start --exec $DAEMON
echo "noip2."
;;
stop)
echo -n "Shutting down dynamic address update:"
start-stop-daemon --stop --oknodo --retry 30 --exec $DAEMON
echo "noip2."
;;
restart)
echo -n "Restarting dynamic address update: "
start-stop-daemon --stop --oknodo --retry 30 --exec $DAEMON
start-stop-daemon --start --exec $DAEMON
echo "noip2."
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment