mirror of
https://github.com/openappsec/openappsec.git
synced 2025-06-28 16:41:02 +03:00
don't exit
This commit is contained in:
parent
3a34984def
commit
8edb695346
@ -104,13 +104,22 @@ while true; do
|
||||
current_watchdog_pid=$(pgrep -f -x -o "/bin/(bash|sh) /etc/cp/watchdog/cp-nano-watchdog")
|
||||
if [ ! -f /tmp/restart_watchdog ] && [ "$current_watchdog_pid" != "$active_watchdog_pid" ]; then
|
||||
echo "Error: Watchdog exited abnormally"
|
||||
exit 1
|
||||
echo "---------------------------------------------------------------------------------------------------" >> /etc/cp/conf/wiaam.txt
|
||||
date >> /etc/cp/conf/wiaam.txt
|
||||
echo "current pid = $current_watchdog_pid" >> /etc/cp/conf/wiaam.txt
|
||||
echo "active pid = $active_watchdog_pid" >> /etc/cp/conf/wiaam.txt
|
||||
elif [ -f /tmp/restart_watchdog ]; then
|
||||
echo "restarting the watch dog " >> /etc/cp/conf/wiaam.txt
|
||||
echo "current pid = $current_watchdog_pid" >> /etc/cp/conf/wiaam.txt
|
||||
echo "active pid = $active_watchdog_pid" >> /etc/cp/conf/wiaam.txt
|
||||
echo "killing pid = $(pgrep -f -x -o "/bin/(bash|sh) /etc/cp/watchdog/cp-nano-watchdog")" >> /etc/cp/conf/wiaam.txt
|
||||
|
||||
rm -f /tmp/restart_watchdog
|
||||
kill -9 "$(pgrep -f -x -o "/bin/(bash|sh) /etc/cp/watchdog/cp-nano-watchdog")"
|
||||
/etc/cp/watchdog/cp-nano-watchdog >/dev/null 2>&1 &
|
||||
sleep 5
|
||||
active_watchdog_pid=$(pgrep -f -x -o "/bin/(bash|sh) /etc/cp/watchdog/cp-nano-watchdog")
|
||||
echo "new active watchdog pid = $active_watchdog_pid"
|
||||
fi
|
||||
|
||||
sleep 5
|
||||
|
Loading…
x
Reference in New Issue
Block a user