Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # c-icap: Start/Stop c-icap
- # chkconfig: - 70 30
- # description: c-icap is an implementation of an ICAP server.
- # processname: c-icap
- # pidfile: /var/run/c-icap/c-icap.pid
- ./etc/rc.d/init.d/functions
- ./etc/sysconfig/network
- CONFIG_FILE=/etc/c-icap.conf
- PID_DIR=/var/run/c-icap
- RETVAL=0
- start() {
- echo -n $"Starting c-icap: "
- daemon /usr/local/bin/c-icap -f $CONFIG_FILE
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/c-icap
- return $RETVAL
- }
- stop() {
- echo -n $"Stopping c-icap: "
- killproc c-icap
- rm -f /var/run/c-icap/c-icap.ctl
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && rm -f $PID_DIR/c-icap.pid /var/lock/subsys/c-icap
- return $RETVAL
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status c-icap
- ;;
- restart)
- stop
- start
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart}"
- exit 1
- esac
- exit $?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement