Skip to content

Commit

Permalink
allow_free test
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkgo committed May 27, 2024
1 parent a6867cc commit 4ecf3b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion FILES/usr/bin/ppg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ load_clash() {
if [ -z "$clash_web_password" ]; then
clash_web_password="clashpass"
fi
if [ "$allow_free" = "yes" ]; then
append_direct=yes
else
append_direct=no
fi
export append_direct
sed "s|https://www.youtube.com/generate_204|$test_node_url|g" /etc/config/clash/clash-dashboard/index_base.html >/etc/config/clash/clash-dashboard/index.html
closeall_flag="yes"
log "[VERSION] :""$(clash -v)" succ
Expand Down Expand Up @@ -335,7 +341,7 @@ load_ovpn() {
gen_hash() {
if [ -f /tmp/ppgw.ini ]; then
. /tmp/ppgw.ini 2>/dev/tty0
str="ppgw""$fake_cidr""$dns_ip""$dns_port""$openport""$sleeptime""$clash_web_port""$clash_web_password""$mode""$udp_enable""$socks5_ip""$socks5_port""$ovpnfile""$ovpn_username""$ovpn_password""$yamlfile""$suburl""$subtime""$fast_node""$test_node_url""$ext_node""$cpudelay""$dns_burn""$ex_dns""$net_rec""$max_rec"
str="ppgw""$fake_cidr""$dns_ip""$dns_port""$openport""$sleeptime""$clash_web_port""$clash_web_password""$mode""$udp_enable""$socks5_ip""$socks5_port""$ovpnfile""$ovpn_username""$ovpn_password""$yamlfile""$suburl""$subtime""$fast_node""$test_node_url""$ext_node""$cpudelay""$dns_burn""$ex_dns""$net_rec""$max_rec""$allow_free"
echo "$str" | md5sum | grep -Eo "[a-z0-9]{32}" | head -1
else
echo "INI does not exist"
Expand Down
6 changes: 5 additions & 1 deletion ppgw.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,11 @@ func filterNodes(nodes []ClashNode, excludedNodes []string) []ClashNode {
}

func isSystemNode(nodeName string) bool {
systemNodes := []string{"REJECT", "DIRECT", "GLOBAL", "UNKNOWN"}
systemNodes := []string{"REJECT", "GLOBAL", "UNKNOWN"}
append_direct := os.Getenv("append_direct")
if append_direct != "yes" {
systemNodes = append(systemNodes, "DIRECT")
}
nodeName = strings.ToUpper(nodeName)
for _, sysNode := range systemNodes {
if nodeName == sysNode {
Expand Down

0 comments on commit 4ecf3b2

Please sign in to comment.