#!/bin/sh

### BEGIN INIT INFO
# Provides:             sdsvrd
# Required-Start:       
# Required-Stop:        
# Default-Start:        2 3 4 5
# Default-Stop:         
# Short-Description:    safedog server
### END INIT INFO

KERNEL_MOD_PATH=/etc/safedog/server/kernelsafedog
test -x `which sdsvrd` || exit 0
test -x `which sdstart` || exit 0
test -x `which sdcmd` || exit 0
test -x `which sdui` || exit 0
test -x `which kill` || exit 0
test -x `which netstat` || exit 0
test -x `which grep` || exit 0
test -x `which awk` || exit 0
touch /etc/safedog/server/monitor/filemonit.txt
touch /etc/safedog/server/monitor/processmonit.txt
touch /etc/safedog/server/monitor/cpumonit.txt
touch /etc/safedog/server/monitor/memorymonit.txt
touch /etc/safedog/server/monitor/diskvolumemonit.txt
touch /etc/safedog/server/monitor/bakforsizemonit.txt

#sdcmd exit >/dev/null 2>&1 &
#sleep 2
#killall sdsvrd >/dev/null 2>&1

#insmod kernel module
insmod $KERNEL_MOD_PATH/sddev.ko
#sdsvrd
sdmonitor -r sdsvrd


exit 0
