Sophie

Sophie

distrib > Mandriva > 9.2 > i586 > by-pkgid > c767792e1dd4fba5cf452fcd2b0dd317 > files > 4

gnunet-0.7.3-1plf2008.1.src.rpm

#!/bin/sh
#
# GNUnet         Start/Stop GNUnet server
#
# chkconfig: - 35 65
# description:	GNUnet is an anonymous distributed secure network
#               this server is required to connect to the network,
#               it will open a TCP port to communicate with the
#               GUI and an UDP port to communicate with the world.
#               The configuration file /etc/gnunetd.conf will be used.
# processname: gnunetd
# pidfile: /var/run/gnunetd/pid
#
# This script was initially written on/for RH/Zen. You may have
# to adapt it. 
#
# Source function library.
. /lib/lsb/init-functions

# Get config.
. /etc/sysconfig/network

# Just in case gnunetd is in /usr/local and not on the path
GNUNETD=/usr/bin/gnunetd

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

RETVAL=0
prog="gnunetd"

start() {
        gprintf "Starting %s: " "$prog"
        daemon $GNUNETD
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gnunetd
	return $RETVAL
}

show_status() {
	status gnunetd
}

stop() {
	gprintf "Stopping %s: " "$prog" 
	killproc gnunetd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gnunetd
	return $RETVAL
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
	show_status
	;;
  restart|reload)
	stop
	start
	;;
  condrestart)
	if [ -f /var/lock/subsys/gnunetd ]; then
            stop
            start
        fi
	;;
  *)
	gprintf "Usage: %s {start|stop|status|restart|reload|condrestart}\n" "$0"
	exit 1
esac

exit $RETVAL