|
From: zszs <zs...@ma...> - 2004-04-13 19:41:30
|
Hi,
I have created the missing ez-ipupdate init script.
It has been derived from noip_updater init sript.
I have tested it and it works fine on my config, but it
would be better if someone else could do some testing.
Here it is:
#!/bin/bash
### BEGIN INIT INFO
# Provides: ez-ipupdate
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 6
# Description: starts ez-ipupdate
### END INIT INFO
# settings
source /etc/sysconfig/config
# parameters
NAME="ez-ipupdate dynamic DNS update service"
CONFIGNAME=EZIP_UPDATE
DAEMON=/usr/bin/ez-ipupdate
CONFIGFILE="/etc/ez-ipupdate/ez-ipupdate.conf"
PARAMETER="-c $CONFIGFILE -F /var/run/ez-ipupdate.pid"
# source function library
source /etc/init.d/functions
eval START=\$START_$CONFIGNAME
# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}
# Force execution if not called by a runlevel directory.
test $link = $base && START=yes
test "$START" = "yes" || exit 0
if [ ! -e $DAEMON ]; then
echo
echo "$DAEMON not found. Did you install the package?"
exit 1
fi
if [ ! -f $CONFIGFILE ]; then
echo
echo "Configuration: $CONFIGFILE not found."
exit 1
fi
case "$1" in
start)
echo -n "Starting $NAME: "
loadproc $DAEMON $PARAMETER
;;
stop)
echo -n "Shutting down $NAME: "
killproc $DAEMON
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
------------
Two more things to modify:
1. Make links
# cd /etc/init.d/rc3.d
# ln -s ../ez-ipupdate K11ez-ipupdate
# ln -s ../ez-ipupdate S10ez-ipupdate
# cd /etc/init.d/rc5.d
# ln -s ../ez-ipupdate K11ez-ipupdate
# ln -s ../ez-ipupdate S10ez-ipupdate
2. Add two lines to /etc/sysconfig/config:
# Start EZIP_UPDATE?
START_EZIP_UPDATE=yes
--
ZsZs
|