From 68c42e0aab1993c97e33c8b8bfbfcb54ad608b87 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 13:28:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E6=97=A5=E5=BF=97=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=97=B6=E5=8C=BA=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luci-app-easytier/root/etc/init.d/easytier | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/luci-app-easytier/root/etc/init.d/easytier b/luci-app-easytier/root/etc/init.d/easytier index 2d3126e..d39eb09 100644 --- a/luci-app-easytier/root/etc/init.d/easytier +++ b/luci-app-easytier/root/etc/init.d/easytier @@ -49,6 +49,18 @@ EOF fi } +get_tz() { + SET_TZ="" + [ -e "/etc/localtime" ] && return + for tzfile in /etc/TZ /var/etc/TZ + do + [ -e "$tzfile" ] || continue + tz="$(cat $tzfile 2>/dev/null)" + done + [ -z "$tz" ] && return + SET_TZ=$tz +} + check_bin() { path=$(dirname "$easytierbin") size="$(df -k | awk '/\/overlay$/ {sub(/K$/, "", $4); print $4}')" @@ -398,6 +410,8 @@ start_et() { else get_etconfig procd_open_instance "easytier_core" + get_tz + [ -z "$SET_TZ" ] || procd_set_param env TZ="$SET_TZ" procd_set_param command "$easytierbin" if [ "$etcmd" = "etcmd" ] ; then [ -z "$network_name" ] || procd_append_param command --network-name "$network_name" @@ -603,6 +617,8 @@ start_web() { api_port="$(uci -q get easytier.@easytierweb[0].api_port)" weblog="$(uci -q get easytier.@easytierweb[0].weblog)" procd_open_instance "easytier_web" + get_tz + [ -z "$SET_TZ" ] || procd_set_param env TZ="$SET_TZ" procd_set_param command "$webbin" [ -z "$db_path" ] || procd_append_param command -d "$db_path" [ -z "$web_protocol" ] || procd_append_param command -p "$web_protocol"