From c3fdd943cb2139f2cce3e6716582ee5ca189a1bc Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 31 Aug 2024 21:53:39 +0800 Subject: [PATCH] cloudflared: reload service if wan inferface has (re)connected 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 (cherry picked from commit 52037eb625a864c7e9b2b4e30b975bc5a8092192) [based upon 23.05 branch] Signed-off-by: Tianling Shen --- net/cloudflared/Makefile | 2 +- net/cloudflared/files/cloudflared.init | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net/cloudflared/Makefile b/net/cloudflared/Makefile index b49ba6282f..c85b23f2ff 100644 --- a/net/cloudflared/Makefile +++ b/net/cloudflared/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cloudflared PKG_VERSION:=2024.4.1 -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)? diff --git a/net/cloudflared/files/cloudflared.init b/net/cloudflared/files/cloudflared.init index ffef8d0931..35794b3687 100755 --- a/net/cloudflared/files/cloudflared.init +++ b/net/cloudflared/files/cloudflared.init @@ -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 } -- 2.30.2