Added gluon-tunneldigger-watchdog

This commit is contained in:
CyrusFox 2016-01-25 00:30:40 +01:00
parent 66915402c5
commit 99c25dd974
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,38 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-tunneldigger-watchdog
PKG_VERSION:=3
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
define Package/gluon-tunneldigger-watchdog
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Automatically restarts tunneldigger if the client crashed
DEPENDS:=gluon-tunneldigger
endef
define Package/gluon-tunneldigger-watchdog/description
Gluon community wifi mesh firmware framework: tunneldigger watchdog
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gluon-tunneldigger-watchdog/install
$(CP) ./files/* $(1)/
endef
define Package/gluon-tunneldigger-watchdog/postinst
endef
$(eval $(call BuildPackage,gluon-tunneldigger-watchdog))

View File

@ -0,0 +1,7 @@
#!/bin/sh
PIDFILE=/var/run/tunneldigger.mesh-vpn.pid
if [ "$(pgrep tunneldigger)" != "$(cat $PIDFILE)" ] && [ "$(uci get tunneldigger.@broker[0].enabled)" == "1" ]; then
/etc/init.d/tunneldigger restart
logger -t tunneldiger-watchdog "Restarted Tunneldigger"
fi

View File

@ -0,0 +1 @@
*/5 * * * * /usr/bin/tunneldigger-watchdog