From bbbcde48dafefcddcb07a673c74b5e6c4e4d2ce3 Mon Sep 17 00:00:00 2001 From: zxl hhyccc <45259624+zxlhhyccc@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:37:55 +0800 Subject: [PATCH] luci-app-openclash: Fix `$` sign not escaping correctly. (#4217) --- luci-app-openclash/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index 53f49f6846..448ecffd1f 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -122,13 +122,13 @@ endef define Package/$(PKG_NAME)/postrm #!/bin/sh - DEFAULT_DNSMASQ_CFGID="$(uci -q show "dhcp.@dnsmasq[0]" | awk 'NR==1 {split($0, conf, /[.=]/); print conf[2]}')" + DEFAULT_DNSMASQ_CFGID="$$(uci -q show "dhcp.@dnsmasq[0]" | awk 'NR==1 {split($0, conf, /[.=]/); print conf[2]}')" if [ -f "/tmp/etc/dnsmasq.conf.$DEFAULT_DNSMASQ_CFGID" ]; then - DNSMASQ_CONF_DIR="$(awk -F '=' '/^conf-dir=/ {print $2}' "/tmp/etc/dnsmasq.conf.$DEFAULT_DNSMASQ_CFGID")" + DNSMASQ_CONF_DIR="$$(awk -F '=' '/^conf-dir=/ {print $2}' "/tmp/etc/dnsmasq.conf.$DEFAULT_DNSMASQ_CFGID")" else DNSMASQ_CONF_DIR="/tmp/dnsmasq.d" fi - DNSMASQ_CONF_DIR=${DNSMASQ_CONF_DIR%*/} + DNSMASQ_CONF_DIR=$${DNSMASQ_CONF_DIR%*/} rm -rf /etc/openclash >/dev/null 2>&1 rm -rf /etc/config/openclash >/dev/null 2>&1 rm -rf /tmp/openclash.log >/dev/null 2>&1 @@ -152,8 +152,10 @@ define Package/$(PKG_NAME)/postrm sed -i '/.*kB maximum content size*/c\export let HTTP_MAX_CONTENT = 1024*100; // 100 kB maximum content size' /usr/share/ucode/luci/http.uc >/dev/null 2>&1 uci -q delete firewall.openclash uci -q commit firewall + [ -f "/etc/config/ucitrack" ] && { uci -q delete ucitrack.@openclash[-1] uci -q commit ucitrack + } rm -rf /tmp/luci-* exit 0 endef