Skip to content

Commit

Permalink
1.7.4g
Browse files Browse the repository at this point in the history
  • Loading branch information
frainzy1477 committed Jun 30, 2020
1 parent 7db153b commit c2885c8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion luasrc/model/cbi/clash/config/groups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ o.inputtitle = translate("Save & Apply")
o.inputstyle = "apply"
o.write = function()
m.uci:commit("clash")
sys.call("/usr/share/clash/provider/pgroups.sh start >/dev/null 2>&1 &")
sys.call("/usr/share/clash/create/pgroups.sh start >/dev/null 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "clash", "config", "create"))
end

Expand Down
8 changes: 4 additions & 4 deletions luasrc/model/cbi/clash/config/ruleprovider_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ o.write = function()
end


sys.call("awk -F ',' '{print $4}' /usr/share/clash/provider/rule_provider.list > /tmp/rule_providers 2>/dev/null")
sys.call("awk -F ',' '{print $4}' /usr/share/clash/create/rule_provider.list > /tmp/rule_providers 2>/dev/null")
file = io.open("/tmp/rule_providers", "r");
local e={},a,o,t
a=nixio.fs.access("/tmp/rule_providers")
Expand All @@ -44,11 +44,11 @@ e[t]={}
e[t].num=string.format(t)


e[t].name=string.sub(luci.sys.exec(string.format("grep -F ',%s' /usr/share/clash/provider/rule_provider.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2)
e[t].name=string.sub(luci.sys.exec(string.format("grep -F ',%s' /usr/share/clash/create/rule_provider.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2)

e[t].behaviour=string.sub(luci.sys.exec(string.format("grep -F ',%s' /usr/share/clash/provider/rule_provider.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2)
e[t].behaviour=string.sub(luci.sys.exec(string.format("grep -F ',%s' /usr/share/clash/create/rule_provider.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2)

e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/clash/provider/rule_provider.list |awk -F ',' '{print $4}' 2>/dev/null",o)),1,-2)
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/clash/create/rule_provider.list |awk -F ',' '{print $4}' 2>/dev/null",o)),1,-2)

if e[t].filename == "" then
e[t].filename=o
Expand Down
2 changes: 1 addition & 1 deletion luasrc/model/cbi/clash/config/rules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ o.inputtitle = translate("Save & Apply")
o.inputstyle = "apply"
o.write = function()
m.uci:commit("clash")
sys.call("/usr/share/clash/provider/rules.sh start >/dev/null 2>&1 &")
sys.call("/usr/share/clash/create/rules.sh start >/dev/null 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "clash", "config", "create"))
end

Expand Down
10 changes: 5 additions & 5 deletions root/usr/share/clash/create/clash_rule_provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

RULE_FILE_NAME="$1"

if [ -z "$(grep ",$RULE_FILE_NAME" /usr/share/clash/provider/rule_provider.list 2>/dev/null)" ]; then
DOWNLOAD_PATH=$(grep -F "$RULE_FILE_NAME" /usr/share/clash/provider/rule_provider.list |awk -F ',' '{print $3$4}' 2>/dev/null)
if [ -z "$(grep ",$RULE_FILE_NAME" /usr/share/clash/create/rule_provider.list 2>/dev/null)" ]; then
DOWNLOAD_PATH=$(grep -F "$RULE_FILE_NAME" /usr/share/clash/create/rule_provider.list |awk -F ',' '{print $3$4}' 2>/dev/null)
else
DOWNLOAD_PATH=$(grep -F ",$RULE_FILE_NAME" /usr/share/clash/provider/rule_provider.list |awk -F ',' '{print $3$4}' 2>/dev/null)
DOWNLOAD_PATH=$(grep -F ",$RULE_FILE_NAME" /usr/share/clash/create/rule_provider.list |awk -F ',' '{print $3$4}' 2>/dev/null)
fi

RULE_FILE_DIR="/etc/clash/ruleprovider/$RULE_FILE_NAME"
Expand All @@ -14,8 +14,8 @@
REAL_LOG="/usr/share/clash/clash_real.txt"

url="https://raw.githubusercontent.com/$DOWNLOAD_PATH"
behavior=$(grep -F $RULE_FILE_NAME /usr/share/clash/provider/rule_provider.list |awk -F ',' '{print $2}' 2>/dev/null)
namee=$(grep -F ",$RULE_FILE_NAME" /usr/share/clash/provider/rule_provider.list |awk -F ',' '{print $4}' | awk -F '.' '{print $1}' 2>/dev/null)
behavior=$(grep -F $RULE_FILE_NAME /usr/share/clash/create/rule_provider.list |awk -F ',' '{print $2}' 2>/dev/null)
namee=$(grep -F ",$RULE_FILE_NAME" /usr/share/clash/create/rule_provider.list |awk -F ',' '{print $4}' | awk -F '.' '{print $1}' 2>/dev/null)
path="./ruleprovider/"$RULE_FILE_NAME""

curl -sL --connect-timeout 5 --retry 2 https://raw.githubusercontent.com/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" >/dev/null 2>&1
Expand Down
2 changes: 1 addition & 1 deletion root/usr/share/clash/create/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CONFIG_YAML_PATH=$(uci get clash.config.use_config 2>/dev/null)
if [ -f $CONFIG_YAML_PATH ] && [ "$(ls -l $CONFIG_YAML_PATH|awk '{print int($5)}')" -ne 0 ];then
cp $CONFIG_YAML_PATH $CLASH_CONFIG 2>/dev/null
fi
SCRIPT="/usr/share/clash/provider/script.yaml"
SCRIPT="/usr/share/clash/create/script.yaml"
rule_providers=$(uci get clash.config.rule_providers 2>/dev/null)
CFG_FILE="/etc/config/clash"
config_name=$(uci get clash.config.name_tag 2>/dev/null)
Expand Down
2 changes: 1 addition & 1 deletion root/usr/share/clash/create/pgroups.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cfg_groups_set()
}

start(){
status=$(ps|grep -c /usr/share/clash/provider/pgroups.sh)
status=$(ps|grep -c /usr/share/clash/create/pgroups.sh)
[ "$status" -gt "3" ] && exit 0

config_load "clash"
Expand Down

0 comments on commit c2885c8

Please sign in to comment.