#!/bin/sh # # upclient This shell script takes care of starting and stopping upclient. # # chkconfig: 2345 80 30 # description: Sends the uptime of the machine it's running on to a server # # processname: upclient # config: /etc/upclient.conf #Servicename SERVICE=upclient # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network if [ ${NETWORKING} = "no" ] then exit 0 fi [ -x /usr/sbin/$SERVICE ] || exit 0 # See how we were called. case "$1" in start) gprintf "Starting $SERVICE: " daemon --user=$SERVICE /usr/sbin/$SERVICE RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE ;; stop) gprintf "Stopping $SERVICE: " killproc $SERVICE RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICE ;; status) status $SERVICE RETVAL=$? ;; restart|reload) $0 stop $0 start RETVAL=$? ;; *) gprintf "Usage: $SERVICE {start|stop|status|restart|reload}\n" exit 1 esac