4 TEMPLATES_DIR=/usr/share/monit-cn
10 if [ ! -r "$filename" ]; then
15 script='BEGIN { RS = "[ \t\n]+" }
18 if (line[j] == "pidfile")
20 pidfiles=$(awk "$script" < "$filename" | sed -e 's/"//g')
21 check_pidfile $pidfiles
31 if [ $RET -eq 1 ]; then
48 if ! kill -0 "$1" >/dev/null 2>&1; then
59 if [ ! -d "$MONIT_DIR" ]; then
62 for i in $(find "$MONIT_DIR" -name '*.conf'); do
64 if [ ! $RET -eq 0 ]; then
65 serviceconf=$(basename $i)
66 echo "CN: Disabled $serviceconf"
72 for i in $(find "$TEMPLATES_DIR" -name '*.conf'); do
74 if [ $RET -eq 0 ]; then
75 serviceconf=$(basename $i)
76 if [ ! -r "$MONIT_DIR"/$serviceconf ]; then
77 echo "CN: Enabled $serviceconf"
83 echo "CN: Stopping/restarting monit service"
84 pkill -9 -f /usr/sbin/monit || true