Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 4122fb51c176aabb0ac1ab1b7ee327ce > files > 4

netdisco-1.0-2mdv2010.0.noarch.rpm

#!/bin/bash
#
# Startup script for the netdisco daemon
#
# chkconfig: 345 95 5
# description: Startup/shutdown script for the Netdisco Admin Daemon
# processname: netdisco
# pidfile: /var/run/netdisco/netdisco.pid
# config: /etc/netdisco.conf

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
        echo -n "Starting netdisco admin daemon:"
        su -l netdisco -c "/usr/sbin/netdisco -p start"
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/netdisco
	;;
  stop)
        echo -n "Stopping netdisco admin daemon:"
        su -l netdisco -c "/usr/sbin/netdisco -p stop"
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netdisco /var/run/netdisco/netdisco.pid
	;;
  restart|reload)
        echo -n "Restarting netdisco admin daemon:"
        su -l netdisco -c "/usr/sbin/netdisco -p restart"
	RETVAL=$?
	;;
  status)
	status netdisco
        su -l netdisco -c "/usr/sbin/netdisco -p status"
	RETVAL=$?
	;;
  *)
	echo "Usage: $0 {start|stop|restart|reload|status}"
	exit 1
esac

exit $RETVAL