cloudflared: reload service if wan inferface has (re)connected
authorTianling Shen <[email protected]>
Sat, 31 Aug 2024 13:53:39 +0000 (21:53 +0800)
committerTianling Shen <[email protected]>
Mon, 2 Sep 2024 05:19:16 +0000 (13:19 +0800)
Sometimes the wan connection needs time to be established (e.g. cold
boot after power loss) and the service may crash as the internet is
yet available. Add a trigger to reload the service once the wan
interface is up.

Signed-off-by: Tianling Shen <[email protected]>
net/cloudflared/Makefile
net/cloudflared/files/cloudflared.init

index 21da32615ccf4e0af9d2ffe2a66283c45996f5c0..bc422da2b579097b433bc43785d60d07c53a4ba0 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cloudflared
 PKG_VERSION:=2024.8.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/cloudflare/cloudflared/tar.gz/$(PKG_VERSION)?
index ffef8d0931c3de6a917b755f79e9ccd620e61a63..35794b3687292890e1c2f1cba21e9d4f7de6e9a5 100755 (executable)
@@ -53,4 +53,5 @@ reload_service() {
 
 service_triggers() {
        procd_add_reload_trigger "$CONF"
+       procd_add_interface_trigger "interface.*.up" "wan" /etc/init.d/cloudflared restart
 }