# HG changeset patch # User Pascal Bellard # Date 1214234107 0 # Node ID 72fa50265748ca24274dc48098d3afa7f5ebc30a # Parent 03bf0c4ade5bc5fd506a01e66d9583ccd6fd18b2 busybox: add zcip stuff diff -r 03bf0c4ade5b -r 72fa50265748 busybox/receipt --- a/busybox/receipt Fri Jun 20 21:49:23 2008 +0000 +++ b/busybox/receipt Mon Jun 23 15:15:07 2008 +0000 @@ -53,6 +53,7 @@ cp stuff/dnsd $fs/etc/init.d cp stuff/udhcpd $fs/etc/init.d cp stuff/inetd $fs/etc/init.d + cp stuff/zcip $fs/etc/init.d cd $fs rm linuxrc ln -s bin/busybox init @@ -62,6 +63,8 @@ cp $src/examples/udhcp/simple.script \ $fs/usr/share/udhcpc/default.script chmod +x $fs/usr/share/udhcpc/default.script + # ZeroConf stuff. + cp stuff/zcip.script $fs/etc } # Force glibc-2.7 reinstall if 2.3.6 still in use. diff -r 03bf0c4ade5b -r 72fa50265748 busybox/stuff/zcip --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/zcip Mon Jun 23 15:15:07 2008 +0000 @@ -0,0 +1,57 @@ +#!/bin/sh +# /etc/init.d/zcip: Start, stop and restart ZeroConf deamon on SliTaz, at boot +# time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=Zcip +DESC="ZeroConf deamon" +DAEMON=/sbin/zcip +OPTIONS=$ZCIP_OPTIONS +PIDFILE=/var/run/zcip.pid + +case "$1" in + start) + if [ -f $PIDFILE ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS && echo `pidof $DAEMON` > $PIDFILE + status + ;; + stop) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + status + ;; + restart) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + sleep 2 + $DAEMON $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r 03bf0c4ade5b -r 72fa50265748 busybox/stuff/zcip.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/zcip.script Mon Jun 23 15:15:07 2008 +0000 @@ -0,0 +1,9 @@ +#!/bin/sh + +[ "$1" = "init" ] && exit 0 +[ -n "$ip" ] || exit 1 +case "$1" in +config) exec ifconfig $interface $ip netmask 255.255.0.0 up;; +deconfig) exec ifconfig $interface down;; +*) exit 1;; +esac