Add service restart on failure
This commit is contained in:
1000
logs/mongodb-status.log
Normal file
1000
logs/mongodb-status.log
Normal file
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,7 @@ if echo "$status" | grep -qE "Active: running|Active: active"; then
|
||||
echo "[$current_time] Success $(echo "$status" | grep "Main PID")" >> $LOG_FILE
|
||||
else
|
||||
echo "[$current_time] Failed" >> $LOG_FILE
|
||||
sudo service mongod restart
|
||||
fi
|
||||
|
||||
lines=$(wc -l < $LOG_FILE)
|
||||
|
||||
Reference in New Issue
Block a user