wok-6.x rev 937

busybox: add zcip stuff
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jun 23 15:15:07 2008 +0000 (2008-06-23)
parents 03bf0c4ade5b
children dbb21026eb5c
files busybox/receipt busybox/stuff/zcip busybox/stuff/zcip.script
line diff
     1.1 --- a/busybox/receipt	Fri Jun 20 21:49:23 2008 +0000
     1.2 +++ b/busybox/receipt	Mon Jun 23 15:15:07 2008 +0000
     1.3 @@ -53,6 +53,7 @@
     1.4      cp stuff/dnsd $fs/etc/init.d
     1.5      cp stuff/udhcpd $fs/etc/init.d
     1.6      cp stuff/inetd $fs/etc/init.d
     1.7 +    cp stuff/zcip $fs/etc/init.d
     1.8      cd $fs
     1.9      rm linuxrc
    1.10      ln -s bin/busybox init
    1.11 @@ -62,6 +63,8 @@
    1.12      cp $src/examples/udhcp/simple.script \
    1.13      $fs/usr/share/udhcpc/default.script
    1.14      chmod +x $fs/usr/share/udhcpc/default.script
    1.15 +    # ZeroConf stuff.
    1.16 +    cp stuff/zcip.script $fs/etc
    1.17  }
    1.18  
    1.19  # Force glibc-2.7 reinstall if 2.3.6 still in use.
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/busybox/stuff/zcip	Mon Jun 23 15:15:07 2008 +0000
     2.3 @@ -0,0 +1,57 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/zcip: Start, stop and restart ZeroConf deamon on SliTaz, at boot
     2.6 +# time or with the command line.
     2.7 +#
     2.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    2.10 +#
    2.11 +. /etc/init.d/rc.functions
    2.12 +. /etc/daemons.conf
    2.13 +
    2.14 +NAME=Zcip
    2.15 +DESC="ZeroConf deamon"
    2.16 +DAEMON=/sbin/zcip
    2.17 +OPTIONS=$ZCIP_OPTIONS
    2.18 +PIDFILE=/var/run/zcip.pid
    2.19 +
    2.20 +case "$1" in
    2.21 +  start)
    2.22 +    if [ -f $PIDFILE ] ; then
    2.23 +      echo "$NAME already running."
    2.24 +      exit 1
    2.25 +    fi
    2.26 +    echo -n "Starting $DESC: $NAME... "
    2.27 +    $DAEMON $OPTIONS && echo `pidof $DAEMON` > $PIDFILE
    2.28 +    status
    2.29 +    ;;
    2.30 +  stop)
    2.31 +    if [ ! -f $PIDFILE ] ; then
    2.32 +      echo "$NAME is not running."
    2.33 +      exit 1
    2.34 +    fi
    2.35 +    echo -n "Stopping $DESC: $NAME... "
    2.36 +    kill `cat $PIDFILE`
    2.37 +    rm $PIDFILE
    2.38 +    status
    2.39 +    ;;
    2.40 +  restart)
    2.41 +    if [ ! -f $PIDFILE ] ; then
    2.42 +      echo "$NAME is not running."
    2.43 +      exit 1
    2.44 +    fi
    2.45 +    echo -n "Restarting $DESC: $NAME... "
    2.46 +    kill `cat $PIDFILE`
    2.47 +    rm $PIDFILE
    2.48 +    sleep 2
    2.49 +    $DAEMON $OPTIONS
    2.50 +    status
    2.51 +    ;;
    2.52 +  *)
    2.53 +    echo ""
    2.54 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    2.55 +    echo ""
    2.56 +    exit 1
    2.57 +    ;;
    2.58 +esac
    2.59 +
    2.60 +exit 0
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/busybox/stuff/zcip.script	Mon Jun 23 15:15:07 2008 +0000
     3.3 @@ -0,0 +1,9 @@
     3.4 +#!/bin/sh
     3.5 +
     3.6 +[ "$1" = "init" ] && exit 0
     3.7 +[ -n "$ip" ] || exit 1
     3.8 +case "$1" in
     3.9 +config)		exec ifconfig $interface $ip netmask 255.255.0.0 up;;
    3.10 +deconfig)	exec ifconfig $interface down;;
    3.11 +*)		exit 1;;
    3.12 +esac