wok annotate ypserv/stuff/ypserv @ rev 11401

Fix: typo in linux-libre-api-headers (thanks to godane)
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sun Dec 11 02:16:15 2011 +0100 (2011-12-11)
parents
children 7f188676b59c
rev   line source
erjo@11349 1 #!/bin/sh
erjo@11349 2 # /etc/init.d/ypserv: Start, stop and restart YP (NIS) Server on SliTaz, at
erjo@11349 3 # boot time or with the command line.
erjo@11349 4 #
erjo@11349 5 # To start YP (NIS) Server at boot time, just put ypserver in the $RUN_DAEMONS
erjo@11349 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
erjo@11349 7 #
erjo@11349 8 . /etc/init.d/rc.functions
erjo@11349 9 . /etc/daemons.conf
erjo@11349 10
erjo@11349 11 NAME=ypserv
erjo@11349 12 DESC="YP (NIS) Server"
erjo@11349 13 DAEMON=/usr/sbin/ypserv
erjo@11349 14 OPTIONS=$YPSERV_OPTIONS
erjo@11349 15 PIDFILE=/var/run/ypserv.pid
erjo@11349 16
erjo@11349 17 case "$1" in
erjo@11349 18 start)
erjo@11349 19 if active_pidfile $PIDFILE ypserv ; then
erjo@11349 20 echo "$NAME already running."
erjo@11349 21 exit 1
erjo@11349 22 fi
erjo@11349 23 echo -n "Starting $DESC: $NAME... "
erjo@11349 24 $DAEMON $OPTIONS
erjo@11349 25 echo "$(pidof ypserv)" > $PIDFILE
erjo@11349 26 status
erjo@11349 27 ;;
erjo@11349 28 stop)
erjo@11349 29 if ! active_pidfile $PIDFILE ypserv ; then
erjo@11349 30 echo "$NAME is not running."
erjo@11349 31 exit 1
erjo@11349 32 fi
erjo@11349 33 echo -n "Stopping $DESC: $NAME... "
erjo@11349 34 kill `cat $PIDFILE`
erjo@11349 35 status
erjo@11349 36 ;;
erjo@11349 37 restart)
erjo@11349 38 if ! active_pidfile $PIDFILE ypserv ; then
erjo@11349 39 echo "$NAME is not running."
erjo@11349 40 exit 1
erjo@11349 41 fi
erjo@11349 42 echo -n "Restarting $DESC: $NAME... "
erjo@11349 43 kill `cat $PIDFILE`
erjo@11349 44 sleep 2
erjo@11349 45 $DAEMON $OPTIONS
erjo@11349 46 status
erjo@11349 47 ;;
erjo@11349 48 *)
erjo@11349 49 echo ""
erjo@11349 50 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
erjo@11349 51 echo ""
erjo@11349 52 exit 1
erjo@11349 53 ;;
erjo@11349 54 esac
erjo@11349 55
erjo@11349 56 exit 0