diff --git a/package/ctcgfw/luci-app-openclash/Makefile b/package/ctcgfw/luci-app-openclash/Makefile index aaabff827a..92684753c0 100644 --- a/package/ctcgfw/luci-app-openclash/Makefile +++ b/package/ctcgfw/luci-app-openclash/Makefile @@ -26,14 +26,13 @@ define Package/$(PKG_NAME)/postinst endef define Build/Prepare - $(CP) $(CURDIR)/files $(PKG_BUILD_DIR) $(foreach po,$(wildcard ${CURDIR}/i18n/zh-cn/*.po), \ po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) - chmod 0755 $(PKG_BUILD_DIR)/files/etc/init.d/openclash - chmod -R 0755 $(PKG_BUILD_DIR)/files/usr/share/openclash/ - mkdir -p $(PKG_BUILD_DIR)/files/etc/openclash/config >/dev/null 2>&1 - mkdir -p $(PKG_BUILD_DIR)/files/etc/openclash/proxy_provider >/dev/null 2>&1 - mkdir -p $(PKG_BUILD_DIR)/files/etc/openclash/backup >/dev/null 2>&1 + chmod 0755 ${CURDIR}/files/etc/init.d/openclash + chmod -R 0755 ${CURDIR}/files/usr/share/openclash/ + mkdir -p ${CURDIR}/files/etc/openclash/config >/dev/null 2>&1 + mkdir -p ${CURDIR}/files/etc/openclash/proxy_provider >/dev/null 2>&1 + mkdir -p ${CURDIR}/files/etc/openclash/backup >/dev/null 2>&1 endef define Build/Configure @@ -158,7 +157,7 @@ endef define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n $(INSTALL_DATA) $(PKG_BUILD_DIR)/*.*.lmo $(1)/usr/lib/lua/luci/i18n/ - $(CP) $(PKG_BUILD_DIR)/files/* $(1)/ + $(CP) ./files/* $(1)/ endef $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_groups_get.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_groups_get.sh index 621165483c..082e397d74 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_groups_get.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_groups_get.sh @@ -102,7 +102,7 @@ num=$(grep -c "name:" $group_file) cfg_get() { - echo "$(grep "$1" "$2" 2>/dev/null |awk -v tag=$1 'BEGIN{FS=tag} {print $2}' 2>/dev/null |sed 's/,.*//' 2>/dev/null |sed 's/^ \{0,\}//g' 2>/dev/null |sed 's/ \{0,\}$//g' 2>/dev/null |sed 's/ \{0,\}\}\{0,\}$//g' 2>/dev/null)" + echo "$(grep "$1" "$2" 2>/dev/null |awk -v tag=$1 'BEGIN{FS=tag} {print $2}' 2>/dev/null |sed 's/,.*//' 2>/dev/null |sed 's/\}.*//' 2>/dev/null |sed 's/^ \{0,\}//g' 2>/dev/null |sed 's/ \{0,\}$//g' 2>/dev/null)" } for n in $line diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_get.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_get.sh index b1d87ac239..e94ff1e3d6 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_get.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_get.sh @@ -80,7 +80,7 @@ provider_count=1 cfg_get() { - echo "$(grep "$1" "$2" 2>/dev/null |awk -v tag=$1 'BEGIN{FS=tag} {print $2}' 2>/dev/null |sed 's/,.*//' 2>/dev/null |sed 's/^ \{0,\}//g' 2>/dev/null |sed 's/ \{0,\}$//g' 2>/dev/null |sed 's/ \{0,\}\}\{0,\}$//g' 2>/dev/null)" + echo "$(grep "$1" "$2" 2>/dev/null |awk -v tag=$1 'BEGIN{FS=tag} {print $2}' 2>/dev/null |sed 's/,.*//' 2>/dev/null |sed 's/\}.*//' 2>/dev/null |sed 's/^ \{0,\}//g' 2>/dev/null |sed 's/ \{0,\}$//g' 2>/dev/null)" } echo "开始更新【$CONFIG_NAME】的代理集配置..." >$START_LOG