clsync.init 807 Bytes
#! /bin/sh
#
# clsync
# chkconfig:    2345 98 02
# pidfile:     /var/run/clsync/clsync.pid

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

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

CLSYNCCMD=/usr/bin/clsync

# Source monit configuration.
if [ -f /etc/sysconfig/clsync ] ; then
. /etc/sysconfig/clsync
fi

[ -f $CLSYNCCMD ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
start)
echo -n "Starting clsync: "
daemon $CLSYNCCMD --pid-file /var/run/clsync/clsync.pid
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/nosearch_cached
;;
stop)
echo -n "Stopping clsync: "
killproc -p /var/run/clsync/clsync.pid
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/clsync
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac

exit $RETVAL