Script to restart bwmon_gargoyle if it goes down

Want to share your OpenWrt / Gargoyle knowledge? Implemented a new feature? Let us know here.

Moderator: Moderators

Post Reply
agrohe21
Posts: 95
Joined: Wed Aug 23, 2017 7:51 pm

Script to restart bwmon_gargoyle if it goes down

Post by agrohe21 »

This small script will check to see if a know request fails and tries to start up the service again. I assume that it is still enabled but crashed for whatever reason, which has happened to me in the past.

Code: Select all

root@Gargoyle:~/scripts# cat mon_bwmon.sh
#!/bin/sh

if [[ "$(bw_get -i total5-upload-day-365 2>&1 | cut -c 0-125 )" ==  "ERROR: Bandwidth query failed, make sure rule with specified id exists, and that you are performing only one query at a time." ]]; then
  /etc/init.d/bwmon_gargoyle start;
fi
Crontab Entry every 10 min

Code: Select all

*/10 * * * * /root/scripts/mon_bwmon.sh
Linksys WRT32x Wired Gateway, Orbi RBK20 Wifi
Linksys WRT32x Wired Gateway, Orbi RBK50 Wifi

Post Reply