From 812d748cc60e99254d768d3fd9ff1d0d5990dbe6 Mon Sep 17 00:00:00 2001 From: SirPdboy <63764630+sirpdboy@users.noreply.github.com> Date: Mon, 27 Sep 2021 22:31:24 +0800 Subject: [PATCH] Delete luci-app-wifidog/root directory --- luci-app-wifidog/root/etc/config/wifidog | 27 ---- luci-app-wifidog/root/etc/init.d/wifidog | 152 ------------------ .../root/etc/uci-defaults/luci-wifidog | 13 -- .../root/usr/sbin/wifidog_check.sh | 10 -- 4 files changed, 202 deletions(-) delete mode 100644 luci-app-wifidog/root/etc/config/wifidog delete mode 100644 luci-app-wifidog/root/etc/init.d/wifidog delete mode 100644 luci-app-wifidog/root/etc/uci-defaults/luci-wifidog delete mode 100644 luci-app-wifidog/root/usr/sbin/wifidog_check.sh diff --git a/luci-app-wifidog/root/etc/config/wifidog b/luci-app-wifidog/root/etc/config/wifidog deleted file mode 100644 index 9b4c542..0000000 --- a/luci-app-wifidog/root/etc/config/wifidog +++ /dev/null @@ -1,27 +0,0 @@ -config wifidog 'wifidog' - option wifidog_enable '1' - - - option gateway_interface 'br-lan' - option externalinterface 'eth0.2' - - - option server_hostname 'www.test.com' - option server_httpport '80' - option server_path '/wifidog/' - - option server_sslAvailable '0' - option server_sslport '443' - option server_LoginScriptPathFragment 'login/?' - option server_PortalScriptPathFragment 'portal/?' - option server_PingScriptPathFragment 'ping/?' - option server_AuthScriptPathFragment 'auth/?' - option server_MsgScriptPathFragment 'gw_message.php?' - - option gateway_port '2060' - option check_interval '60' - option client_timeout '5' - -config trustedmaclist - -config allowrule diff --git a/luci-app-wifidog/root/etc/init.d/wifidog b/luci-app-wifidog/root/etc/init.d/wifidog deleted file mode 100644 index 372e123..0000000 --- a/luci-app-wifidog/root/etc/init.d/wifidog +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org -#modify by walkingsky - -START=65 -USE_PROCD=1 -EXTRA_COMMANDS="status" -EXTRA_HELP=" status Print the status of the service" - -local mac_args="TrustedMACList " -local allowrule="" - -add_mac(){ - config_load wifidog - local cfg="$1" - config_get mac "$cfg" mac - if [ "$mac_args" = "TrustedMACList " ]; then - mac_args="$mac_args $mac" - else - mac_args="$mac_args,$mac" - fi -} - - -add_allowrule(){ - config_load wifidog - local cfg="$1" - config_get protocol "$cfg" protocol - config_get ip "$cfg" ip - config_get port "$cfg" port - - allowrule="$allowrule - FirewallRule allow $protocol port $port to $ip " -} - - -#wifidog ?? -create_config(){ - - config_load wifidog - - - gateway_id=`ifconfig | grep HWaddr | awk -F" " '{print $5}' | awk '$1~//{print;exit}' | sed 's/://g'` - config_get gateway_id "wifidog" "gateway_id" $gateway_id - config_get externalinterface "wifidog" "externalinterface" "eth0.2" - config_get gateway_interface "wifidog" "gateway_interface" "br-lan" - config_get server_hostname "wifidog" "server_hostname" "www.test.com" - config_get server_httpport "wifidog" "server_httpport" "80" - config_get server_path "wifidog" "server_path" "/wifidog/" - - config_get server_sslAvailable "wifidog" "server_sslAvailable" "0" - config_get server_sslport "wifidog" "server_sslport" "443" - config_get server_LoginScriptPathFragment "wifidog" "server_LoginScriptPathFragment" "login/?" - config_get server_PortalScriptPathFragment "wifidog" "server_PortalScriptPathFragment" "portal/?" - config_get server_PingScriptPathFragment "wifidog" "server_PingScriptPathFragment" "ping/?" - config_get server_AuthScriptPathFragment "wifidog" "server_AuthScriptPathFragment" "auth/?" - config_get server_MsgScriptPathFragment "wifidog" "server_MsgScriptPathFragment" "gw_message.php?" - config_get gateway_port "wifidog" "gateway_port" "2060" - config_get check_interval "wifidog" "check_interval" "60" - config_get client_timeout "wifidog" "client_timeout" "5" - - - if [ $server_sslAvailable -eq 0 ]; then - server_sslAvailable="no" - else - server_sslAvailable="yes" - fi - - config_foreach add_mac trustedmaclist - config_foreach add_allowrule allowrule - - if [ "$mac_args" = "TrustedMACList " ]; then - $mac_args="" - fi - - echo " -GatewayID $gateway_id -GatewayInterface $gateway_interface -externalinterface $externalinterface - -GatewayPort $gateway_port - -AuthServer { - Hostname $server_hostname - SSLAvailable $server_sslAvailable - SSLPort $server_sslport - HTTPPort $server_httpport - Path $server_path - LoginScriptPathFragment $server_LoginScriptPathFragment - PortalScriptPathFragment $server_PortalScriptPathFragment - MsgScriptPathFragment $server_MsgScriptPathFragment - PingScriptPathFragment $server_PingScriptPathFragment - AuthScriptPathFragment $server_AuthScriptPathFragment -} - -CheckInterval $check_interval -ClientTimeout $client_timeout - -$mac_args - -FirewallRuleSet validating-users { - FirewallRule allow to 0.0.0.0/0 -} - -FirewallRuleSet known-users { - FirewallRule allow to 0.0.0.0/0 -} - -FirewallRuleSet global { - $allowrule -} - -FirewallRuleSet unknown-users { - FirewallRule allow udp port 53 - FirewallRule allow tcp port 53 - FirewallRule allow udp port 67 - FirewallRule allow tcp port 67 -} - -FirewallRuleSet locked-users { - FirewallRule block to 0.0.0.0/0 -} -" > /etc/wifidog.conf - - - -} - -start_service() { - config_load wifidog - - config_get wifidog_enable "wifidog" "wifidog_enable" "0" - if [ $wifidog_enable -eq 0 ]; then - stop - exit - fi - - create_config - - sleep 1 - procd_open_instance - # -s: log to syslog - # -f: run in foreground - procd_set_param command /usr/bin/wifidog -s -f - procd_set_param respawn # respawn automatically if something died - procd_set_param file /etc/wifidog.conf - procd_close_instance -} - -status() { - /usr/bin/wdctl status -} diff --git a/luci-app-wifidog/root/etc/uci-defaults/luci-wifidog b/luci-app-wifidog/root/etc/uci-defaults/luci-wifidog deleted file mode 100644 index 1ae0190..0000000 --- a/luci-app-wifidog/root/etc/uci-defaults/luci-wifidog +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@wifidog[-1] - add ucitrack wifidog - set ucitrack.@wifidog[-1].init=wifidog - #delete ucitrack.@firewall[0].affects - add_list ucitrack.@firewall[0].affects=wifidog - commit ucitrack -EOF - -rm -f /tmp/luci-indexcache -exit 0 \ No newline at end of file diff --git a/luci-app-wifidog/root/usr/sbin/wifidog_check.sh b/luci-app-wifidog/root/usr/sbin/wifidog_check.sh deleted file mode 100644 index fbfe94b..0000000 --- a/luci-app-wifidog/root/usr/sbin/wifidog_check.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -#walkingsky -#tangxn_1@163.com - -local run=`ps | grep "wifidog -c /tmp/wifidog.conf" | wc -l` - -if [ $run -lt 2 ]; then - wifidog -c /tmp/wifidog.conf -fi \ No newline at end of file