luci-app-openclash: sync with upstream source

This commit is contained in:
CN_SZTL 2020-02-28 00:57:28 +08:00
parent 4b55af17a4
commit 743eab33f5
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
7 changed files with 22 additions and 13 deletions

View File

@ -26,13 +26,14 @@ define Package/$(PKG_NAME)/postinst
endef
define Build/Prepare
$(CP) $(CURDIR)/files $(PKG_BUILD_DIR)
$(foreach po,$(wildcard ${CURDIR}/i18n/zh_Hans/*.po), \
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
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
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
endef
define Build/Configure
@ -157,7 +158,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) ./files/* $(1)/
$(CP) $(PKG_BUILD_DIR)/files/* $(1)/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -10,7 +10,7 @@ CRON_FILE="/etc/crontabs/root"
CONFIG_FILE=$(uci get openclash.config.config_path 2>/dev/null)
LOG_FILE="/tmp/openclash.log"
START_LOG="/tmp/openclash_start.log"
BACKUP_FILE="/etc/openclash/backup/$(uci get openclash.config.config_path |awk -F '/' '{print $5}' 2>/dev/null)"
BACKUP_FILE="/etc/openclash/backup/$(uci get openclash.config.config_path 2>/dev/null |awk -F '/' '{print $5}' 2>/dev/null)"
START_BACKUP="/tmp/config.sbak"
CHANGE_FILE="/tmp/yaml_change.yaml"
RULE_FILE="/tmp/yaml_rules.yaml"

View File

@ -27,7 +27,7 @@ function index()
entry({"admin", "services", "openclash", "servers-config"},cbi("openclash/servers-config"), nil).leaf = true
entry({"admin", "services", "openclash", "groups-config"},cbi("openclash/groups-config"), nil).leaf = true
entry({"admin", "services", "openclash", "proxy-provider-config"},cbi("openclash/proxy-provider-config"), nil).leaf = true
entry({"admin", "services", "openclash", "config"},form("openclash/config"),_("Server Config"), 70).leaf = true
entry({"admin", "services", "openclash", "config"},form("openclash/config"),_("Config Manage"), 70).leaf = true
entry({"admin", "services", "openclash", "log"},form("openclash/log"),_("Logs"), 80).leaf = true
end

View File

@ -24,7 +24,7 @@ function IsYmlFile(e)
return e == ".yml"
end
ful = SimpleForm("upload", translate("Server Config"), nil)
ful = SimpleForm("upload", translate("Config Manage"), nil)
ful.reset = false
ful.submit = false

View File

@ -154,7 +154,7 @@
function sponsorpage()
{
url7='https://github.com/vernesong/OpenClash/wiki/Sponsor';
url7='https://ko-fi.com/vernesong';
window.open(url7);
}

View File

@ -7,6 +7,7 @@ PROXY_ROUTE_TABLE="0x162"
enable_redirect_dns=$(uci get openclash.config.enable_redirect_dns 2>/dev/null)
dns_port=$(uci get openclash.config.dns_port 2>/dev/null)
disable_masq_cache=$(uci get openclash.config.disable_masq_cache 2>/dev/null)
en_mode=$(uci get openclash.config.en_mode 2>/dev/null)
CRASH_NUM=0
while :;
@ -22,8 +23,15 @@ if [ "$enable" -eq 1 ]; then
echo "${LOGTIME} Watchdog: Clash Core Problem, Restart." >> $LOG_FILE
nohup "$CLASH" -d "$CLASH_CONFIG" -f "$CONFIG_FILE" >> $LOG_FILE 2>&1 &
sleep 3
ip route replace default dev utun table "$PROXY_ROUTE_TABLE" 2>/dev/null
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" 2>/dev/null
if [ "$en_mode" = "fake-ip-tun" ] || [ "$en_mode" = "redir-host-tun" ]; then
ip route replace default dev utun table "$PROXY_ROUTE_TABLE" 2>/dev/null
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" 2>/dev/null
elif [ "$en_mode" = "redir-host-vpn" ] || [ "$en_mode" = "fake-ip-vpn" ]; then
ip tuntap add user root mode tun clash0
ip link set clash0 up
ip route replace default dev clash0 table "$PROXY_ROUTE_TABLE"
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE"
fi
/usr/share/openclash/openclash_history_set.sh
else
echo "${LOGTIME} Watchdog: Already Restart 3 Times With Clash Core Problem, Auto-Exit." >> $LOG_FILE

View File

@ -237,7 +237,7 @@ msgstr ""
msgid "Rules Setting"
msgstr "规则设置(访问控制)"
msgid "Server Config"
msgid "Config Manage"
msgstr "配置文件管理"
msgid "Upload File Type"