Added gluon-tunneldigger-watchdog
This commit is contained in:
parent
66915402c5
commit
99c25dd974
38
package/gluon-tunneldigger-watchdog/Makefile
Normal file
38
package/gluon-tunneldigger-watchdog/Makefile
Normal 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))
|
7
package/gluon-tunneldigger-watchdog/files/usr/bin/tunneldigger-watchdog
Executable file
7
package/gluon-tunneldigger-watchdog/files/usr/bin/tunneldigger-watchdog
Executable 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
|
@ -0,0 +1 @@
|
|||||||
|
*/5 * * * * /usr/bin/tunneldigger-watchdog
|
Loading…
Reference in New Issue
Block a user