├── .gitignore ├── README.md ├── app_ver_n.txt ├── go.sh ├── mtd_storage.sh ├── nps.sh ├── script ├── Sh01_mountopt.sh ├── Sh02_kms.sh ├── Sh03_jbls.sh ├── Sh04_mento_hust.sh ├── Sh05_cry_fs.sh ├── Sh05_go_cryptfs.sh ├── Sh08_hysteria.sh ├── Sh09_chinadns_ng.sh ├── Sh10_clash.sh ├── Sh11_ad_byby.sh ├── Sh12_ad_m.sh ├── Sh13_kool_proxy.sh ├── Sh14_kcp_tun.sh ├── Sh15_ss.sh ├── Sh16_cow.sh ├── Sh17_meow.sh ├── Sh18_v2ray.sh ├── Sh19_chinadns.sh ├── Sh20_fakeincn.sh ├── Sh21_mproxy.sh ├── Sh22_tinyproxy.sh ├── Sh23_vpnproxy.sh ├── Sh24_ssserver.sh ├── Sh25_softether.sh ├── Sh26_upd2pro.sh ├── Sh27_printer.sh ├── Sh27_speedup.sh ├── Sh28_guest_kit.sh ├── Sh30_np_s.sh ├── Sh31_orayd.sh ├── Sh32_frp.sh ├── Sh33_ngrok.sh ├── Sh34_wifi_dog.sh ├── Sh39_ipt2socks.sh ├── Sh40_dns_com_pod.sh ├── Sh41_dnspod.sh ├── Sh42_aliddns.sh ├── Sh43_cloudxns.sh ├── Sh43_huaweidns.sh ├── Sh44_cloudflare.sh ├── Sh45_server_chan.sh ├── Sh45_wx_send.sh ├── Sh46_display.sh ├── Sh47_ssrserver.sh ├── Sh48_Fast_Dick.sh ├── Sh49_qcloud.sh ├── Sh50_tg_bot.sh ├── Sh51_xun_lei.sh ├── Sh52_sync_thing.sh ├── Sh53_you_ku.sh ├── Sh54_file_manager.sh ├── Sh55_very_sync.sh ├── Sh56_gofly_way.sh ├── Sh57_virtual_here.sh ├── Sh58_tran_socks.sh ├── Sh59_trans_late.sh ├── Sh61_lnmp.sh ├── Sh62_shellina_box.sh ├── Sh63_t_mall.sh ├── Sh84_v2raya.sh ├── Sh85_mad_dy.sh ├── Sh86_go_tify.sh ├── Sh87_cad_dy.sh ├── Sh88_ddns_go.sh ├── Sh89_tailscale.sh ├── Sh90_ddns_to.sh ├── Sh91_AdGuard_Home.sh ├── Sh92_arozos.sh ├── Sh93_zoraxy.sh ├── Sh99_ss_tproxy.sh ├── init.sh ├── sh_0_script.sh ├── sh_emi.sh ├── sh_ezscript.sh ├── sh_link.sh ├── sh_opt_script_check.sh ├── sh_ss_tproxy.sh └── sh_upscript.sh ├── scriptsh.txt ├── sh_onmp.sh ├── sh_onmp8.sh ├── up.sh ├── v2ray.sh ├── www_sh ├── ADM ├── AdGuardHome ├── Adbyby ├── Aliddns ├── ArozOS ├── COW ├── CloudXNS ├── DNSPod ├── Kcptun ├── MEOW ├── Ngrok ├── SSR_Server ├── SS_Server ├── SS节点 ├── SS配置 ├── SoftEtherVPN ├── Wifidog ├── Zoraxy ├── caddy ├── chinadns ├── chinadns_ng ├── clash ├── cloudflare ├── cryfs ├── ddnsgo ├── ddnsto ├── filemanager ├── frp ├── gocryptfs ├── goflyway ├── gotify推送 ├── guestkit ├── huaweidns ├── hysteria ├── ipt2socks ├── koolproxy ├── maddy ├── menu_title.sh ├── menu_title.txt ├── nps ├── qcloud ├── ss_tproxy ├── tailscale ├── tgbot ├── tmall ├── translate ├── transocks ├── upd2pro ├── v2ray ├── v2raya ├── verysync ├── virtualhere ├── 假装在中国 ├── 家庭云提速 ├── 微信推送 ├── 搭建Web环境 ├── 相框设置 ├── 网页终端 ├── 自建微信推送 ├── 花生壳内网版 ├── 连接打印机 ├── 配置扩展环境 └── 锐捷认证 └── www_shsh.txt /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hiboyhiboy/opt-script/00e82e81a8952e036284cb6282f4e1e455d9d3d0/.gitignore -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # opt-script 2 | opt-script 3 | -------------------------------------------------------------------------------- /app_ver_n.txt: -------------------------------------------------------------------------------- 1 | 2 | nvram set lnmpt=2018-11-19 3 | nvram set app1_ver_n=2017-8-6 4 | nvram set app2_ver_n=2018-12-31 5 | nvram set app3_ver_n=2017-12-9 6 | nvram set app4_ver_n=2022-08-01 7 | nvram set app5_ver_n=2022-08-20 8 | nvram set app6_ver_n=2018-1-16 9 | nvram set app7_ver_n=2018-3-2 10 | nvram set app8_ver_n=2018-3-8 11 | nvram set app9_ver_n=2020-02-10 12 | nvram set app10_ver_n=2021-02-21 13 | nvram set app11_ver_n=2023-04-19 14 | nvram set app12_ver_n=2023-05-14 15 | nvram set app13_ver_n=2020-02-22 16 | nvram set app14_ver_n=2024-1-28 17 | nvram set app15_ver_n=2019-8-12 18 | nvram set app16_ver_n=2019-6-26 19 | nvram set app17_ver_n=2021-3-7 20 | nvram set app18_ver_n=2022-09-17 21 | nvram set app19_ver_n=2024-04-13 22 | nvram set app20_ver_n=2023-02-16 23 | nvram set app21_ver_n=2023-01-01 24 | nvram set app22_ver_n=2023-05-14 25 | nvram set app23_ver_n=2021-07-28 26 | nvram set app24_ver_n=2023-02-16 27 | nvram set app25_ver_n=2023-07-30 28 | nvram set app26_ver_n=2023-08-20 29 | nvram set app27_ver_n=2023-08-23 30 | nvram set app28_ver_n=2023-08-29 31 | nvram set app29_ver_n=2024-04-13 32 | nvram set app30_ver_n=2024-05-30 33 | nvram set app31_ver_n=2024-05-31 34 | -------------------------------------------------------------------------------- /script/Sh02_kms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | kms_enable=`nvram get kms_enable` 5 | [ -z $kms_enable ] && kms_enable=0 && nvram set kms_enable=0 6 | #[ "$kms_enable" != "0" ] && nvramshow=`nvram showall | grep '=' | grep kms | awk '{print gensub(/'"'"'/,"'"'"'\"'"'"'\"'"'"'","g",$0);}'| awk '{print gensub(/=/,"='\''",1,$0)"'\'';";}'` && eval $nvramshow 7 | 8 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep kms)" ] && [ ! -s /tmp/script/_kms ] ; then 9 | mkdir -p /tmp/script 10 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_kms 11 | chmod 777 /tmp/script/_kms 12 | fi 13 | 14 | kms_check () { 15 | if [ "$kms_enable" != "1" ] ; then 16 | [ ! -z "`pidof vlmcsd`" ] && logger -t "【kms】" "停止 vlmcsd" && kms_close 17 | { kill_ps "$scriptname" exit0; exit 0; } 18 | fi 19 | [ -z "`pidof vlmcsd`" ] && sleep 20 20 | if [ -z "`pidof vlmcsd`" ] && [ "$kms_enable" = "1" ] ; then 21 | kms_close 22 | kms_start 23 | fi 24 | 25 | } 26 | 27 | kms_keep () { 28 | i_app_keep -name="kms" -pidof="vlmcsd" & 29 | } 30 | 31 | kms_close () { 32 | kill_ps "$scriptname keep" 33 | sed -Ei '/【kms】|^$/d' /tmp/script/_opt_script_check 34 | sed -Ei '/_vlmcs._tcp/d' /etc/storage/dnsmasq/dnsmasq.conf; restart_on_dhcpd; 35 | killall vlmcsd vlmcsdini_script.sh 36 | kill_ps "/tmp/script/_kms" 37 | kill_ps "_kms.sh" 38 | kill_ps "$scriptname" 39 | } 40 | 41 | kms_start () { 42 | 43 | check_webui_yes 44 | cmd_log_enable=`nvram get cmd_log_enable` 45 | cmd_log=' -l /tmp/vlmcsd.log ' 46 | [ "$cmd_log_enable" = "1" ] && cmd_log=' -v -l syslog ' 47 | [ ! -f /etc_ro/vlmcsd.kmd ] && /usr/bin/vlmcsd -i /etc/storage/vlmcsdini_script.sh $cmd_log 48 | [ -f /etc_ro/vlmcsd.kmd ] && /usr/bin/vlmcsd -j /etc_ro/vlmcsd.kmd -i /etc/storage/vlmcsdini_script.sh $cmd_log 49 | computer_name=`nvram get computer_name` 50 | sed -Ei '/_vlmcs._tcp/d' /etc/storage/dnsmasq/dnsmasq.conf 51 | nvram set lan_domain="lan" 52 | echo "srv-host=_vlmcs._tcp.lan,$computer_name.lan,1688,0,100" >> /etc/storage/dnsmasq/dnsmasq.conf 53 | /etc/storage/vlmcsdini_script.sh 54 | restart_on_dhcpd 55 | sleep 4 56 | [ ! -z "`pidof vlmcsd`" ] && logger -t "【kms】" "启动成功" 57 | [ -z "`pidof vlmcsd`" ] && logger -t "【kms】" "启动失败, 注意检查端口是否有冲突,10 秒后自动尝试重新启动" && sleep 10 && { eval "$scriptfilepath &"; exit 0; } 58 | eval "$scriptfilepath keep &" 59 | exit 0 60 | } 61 | 62 | initconfig () { 63 | vlmcsdini_script="/etc/storage/vlmcsdini_script.sh" 64 | if [ ! -f "$vlmcsdini_script" ] || [ ! -s "$vlmcsdini_script" ] ; then 65 | cat > "$vlmcsdini_script" <<-\EEE 66 | # Office手动激活命令: 67 | 68 | # cd C:\Program Files\Microsoft Office\Office15 69 | # cscript ospp.vbs /sethst:192.168.123.1 70 | # cscript ospp.vbs /act 71 | # cscript ospp.vbs /dstatus 72 | 73 | # windows手动激活命令 74 | 75 | # slmgr.vbs /upk 76 | # slmgr.vbs /skms 192.168.123.1 77 | # slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX 78 | # slmgr.vbs /ato 79 | # slmgr.vbs /xpr 80 | 81 | # key查看 82 | # https://docs.microsoft.com/en-us/windows-server/get-started/kmsclientkeys 83 | 84 | 85 | #开头的字符号(#)或分号(;)的每一行被视为注释;删除(;)启用指定选项。 86 | #明确设置Windows的ePID / HwId 87 | ;Windows = 06401-00206-471-111111-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 88 | 89 | #明确设置Office 2010(包括Visio和Project)的ePID 90 | ;Office2010 = 06401-00096-199-222222-03-1033-17763.0000-2822018 91 | 92 | #明确设置Office 2013(包括Visio和Project)的ePID / HwId 93 | ;Office2013 = 06401-00206-234-333333-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 94 | 95 | #明确设置Office 2016(包括Visio和Project)的ePID / HwId 96 | ;Office2016 = 06401-00206-437-444444-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 97 | 98 | #明确设置Office 2019(包括Visio和Project)的ePID / HwId 99 | ;Office2019 = 06401-00206-666-666666-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 100 | #明确为Windows中国政府(企业G / GN)设置ePID / HwId 101 | ;WinChinaGov = 06401-03858-000-555555-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 102 | 103 | #使用兼容的VPN设备创建隐藏的本地IPv4地址 104 | #命令行: -O 105 | #VPN = [= ] [/ ] [:] 106 | #使用VPN适配器“KMS Mirror”为其提供IP地址192.168.123.100,租期为一天,并使整个192.168.128.x成为隐藏的本地IPv4地址。 107 | ;VPN = KMS Mirror=192.168.123.100/24:1d 108 | 109 | #使用自定义TCP端口 110 | #命令行: -P 111 | #***只有在编译vlmcsd以使用MS RPC或简单套接字时,Port指令才有效 112 | #***否则使用Listen 113 | ;Port = 1688 114 | 115 | #监听所有IPv4地址(默认端口1688) 116 | # Command line: -L 117 | # Does not work with MS RPC or simple sockets, use Port= 118 | ;Listen = 0.0.0.0:1688 119 | 120 | #监听所有IPv6地址(默认端口1688) 121 | # Command line: -L 122 | ;Listen = [::]:1688 123 | 124 | #侦听所有私有IP地址并拒绝来自公共IP地址的传入请求 125 | # Command line: -o 126 | # PublicIPProtectionLevel = 3 127 | 128 | #允许绑定到外部IP地址 129 | # Command line: -F0 and -F1 130 | ;FreeBind = true 131 | 132 | #在程序启动时随机化ePID(仅限未明确指定的那些) 133 | # Command line: -r 134 | ;RandomizationLevel = 1 135 | 136 | #即使ePID是随机的,也要在ePID中使用特定的主机版本 137 | # Command line: -H 138 | ;HostBuild = 17763 139 | 140 | #即使ePID是随机的,也要在ePID中使用特定的文化(1033 = English US) 141 | # Command line: -C 142 | ;LCID = 1033 143 | 144 | #最多设置4个同时工作(分叉进程或线程) 145 | # Command line: -m 146 | ;MaxWorkers = 4 147 | 148 | #在30秒不活动后断开用户连接 149 | # Command line: -t 150 | ;ConnectionTimeout = 30 151 | 152 | #每次请求后立即断开客户端连接 153 | # Command line: -d and -k 154 | ;DisconnectClientsImmediately = yes 155 | 156 | #编写一个pid文件(包含进程ID为vlmcsd的文件) 157 | # Command line: -p 158 | ;PidFile = /var/run/vlmcsd.pid 159 | 160 | # Load a KMS data file 161 | # Command line: -j 162 | ;KmsData = /etc/vlmcsd.kmd 163 | 164 | #将日志写入/var/log/vlmcsd.log 165 | # Command line: -l (-e and -f also override this directive) 166 | ;LogFile = /var/log/vlmcsd.log 167 | 168 | #不要在日志中包含日期和时间(默认为true) 169 | # Command line: -T0 and -T1 170 | ;LogDateAndTime = false 171 | 172 | #创建详细日志 173 | # Command line: -v and -q 174 | ;LogVerbose = true 175 | 176 | #将已知产品列入白名单 177 | # Command line: -K0, -K1, -K2, -K3 178 | ;WhiteListingLevel = 0 179 | 180 | #检查客户端时间是否在系统时间的+/- 4小时之内 181 | # Command line: -c0, -c1 182 | ;CheckClientTime = false 183 | 184 | # Maintain a list of CMIDs 185 | # Command line: -M0, -M1 186 | ;MaintainClients = false 187 | 188 | # Start with empty CMID list (Requires MaintainClients = true) 189 | # Command line: -E0, -E1 190 | ;StartEmpty = false 191 | 192 | #设置激活间隔2小时 193 | # Command line: -A 194 | ;ActivationInterval = 2h 195 | 196 | #设置更新间隔7天 197 | # Command line: -R 198 | ;RenewalInterval = 7d 199 | 200 | # Exit vlmcsd if warning of certain level has been reached 201 | # Command line: -x 202 | # 0 = Never 203 | # 1 = Exit, if any listening socket could not be established or TAP error occurs 204 | ;ExitLevel = 0 205 | 206 | #运行程序的用户为vlmcsduser 207 | # Command line: -u 208 | ;user = vlmcsduser 209 | 210 | #运行程序的组为vlmcsdgroup 211 | # Command line: -g 212 | ;group = vlmcsdgroup 213 | 214 | #禁用或启用RPC的NDR64传输语法(默认启用) 215 | # Command line: -N0 and -N1 216 | ;UseNDR64 = true 217 | 218 | #禁用或启用RPC的绑定时间特性协商(默认启用) 219 | # Command line: -B0 and -B1 220 | ;UseBTFN = true 221 | 222 | EEE 223 | chmod 755 "$vlmcsdini_script" 224 | fi 225 | 226 | 227 | } 228 | 229 | initconfig 230 | 231 | case $ACTION in 232 | start) 233 | kms_close 234 | kms_check 235 | ;; 236 | check) 237 | kms_check 238 | ;; 239 | stop) 240 | kms_close 241 | ;; 242 | keep) 243 | #kms_check 244 | kms_keep 245 | ;; 246 | *) 247 | kms_check 248 | ;; 249 | esac 250 | 251 | -------------------------------------------------------------------------------- /script/Sh03_jbls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "Sh03_jbls.sh" 5 | exit 6 | source /etc/storage/script/init.sh 7 | jbls_enable=`nvram get jbls_enable` 8 | [ -z $jbls_enable ] && jbls_enable=0 && nvram set jbls_enable=0 9 | #[ "$jbls_enable" != "0" ] && nvramshow=`nvram showall | grep '=' | grep jbls | awk '{print gensub(/'"'"'/,"'"'"'\"'"'"'\"'"'"'","g",$0);}'| awk '{print gensub(/=/,"='\''",1,$0)"'\'';";}'` && eval $nvramshow 10 | 11 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep jbls)" ] && [ ! -s /tmp/script/_jbls ] ; then 12 | mkdir -p /tmp/script 13 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_jbls 14 | chmod 777 /tmp/script/_jbls 15 | fi 16 | 17 | jbls_check () { 18 | if [ "$jbls_enable" != "1" ] ; then 19 | [ ! -z "`pidof jblicsvr`" ] && logger -t "【jbls】" "停止 jblicsvr" && jbls_close 20 | { kill_ps "$scriptname" exit0; exit 0; } 21 | fi 22 | [ -z "`pidof jblicsvr`" ] && sleep 20 23 | if [ -z "`pidof jblicsvr`" ] && [ "$jbls_enable" = "1" ] ; then 24 | jbls_close 25 | jbls_start 26 | fi 27 | 28 | } 29 | 30 | jbls_keep () { 31 | i_app_keep -name="jbls" -pidof="jblicsvr" & 32 | } 33 | 34 | jbls_close () { 35 | kill_ps "$scriptname keep" 36 | sed -Ei '/【jbls】|^$/d' /tmp/script/_opt_script_check 37 | sed -Ei '/txt-record=_jetbrains-license-server.lan/d' /etc/storage/dnsmasq/dnsmasq.conf 38 | killall jblicsvr jbls_script.sh 39 | kill_ps "/tmp/script/_jbls" 40 | kill_ps "_jbls.sh" 41 | kill_ps "$scriptname" 42 | } 43 | 44 | jbls_start () { 45 | 46 | check_webui_yes 47 | cmd_log_enable=`nvram get cmd_log_enable` 48 | cmd_name="jbls" 49 | cmd_log="" 50 | [ "$cmd_log_enable" = "1" ] && cmd_log="$cmd_log2" 51 | #jblicsvr -d -p 1027 52 | eval "/etc/storage/jbls_script.sh $cmd_log" & 53 | sleep 4 54 | [ ! -z "`pidof jblicsvr`" ] && logger -t "【jbls】" "启动成功" 55 | [ -z "`pidof jblicsvr`" ] && logger -t "【jbls】" "启动失败, 注意检查端口是否有冲突,10 秒后自动尝试重新启动" && sleep 10 && { eval "$scriptfilepath &"; exit 0; } 56 | eval "$scriptfilepath keep &" 57 | exit 0 58 | } 59 | 60 | initconfig () { 61 | 62 | jbls_script="/etc/storage/jbls_script.sh" 63 | if [ ! -f "$jbls_script" ] || [ ! -s "$jbls_script" ] ; then 64 | cat > "$jbls_script" <<-\EEE 65 | #!/bin/bash 66 | export PATH='/etc/storage/bin:/tmp/script:/etc/storage/script:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin' 67 | export LD_LIBRARY_PATH=/lib:/opt/lib 68 | 69 | # 感谢bigandy编译和提供: 70 | # jetbrains license server 。 71 | # 进展: Deamon 开发完成,通过了 IDEA, CLION 的验证测试。 72 | # 特点:纯C编写,编译后仅16K大小,不给路由存储增加压力,独立http 服务。 73 | # 适用情况:理论上适用于所有 Jetbrains 产品,但未完全测试。使用环境:padavan 路由hiboay固件,其他固件运行情况未知。 74 | 75 | # 使用方法: 76 | 77 | # Jetbrains License Server Emulator build Jan 13 2017 13:04:12 78 | 79 | # usage: jblicsvr [option] 80 | # option: 81 | 82 | # -d run on daemon mode 83 | # -p port to listen 84 | # -s seconds of prolongation period 85 | # -u license to user name 86 | 87 | # -d 进入守护进程模式 88 | # -p httpd侦听端口,默认 1027 ,原作者女友生日 89 | # -s license 有效时间(单位:秒),默认约为7天多(607875500),原厂server传递的数值。 90 | # -u 授权给谁,默认为ilanyu(原作者)。 91 | # 彩蛋:http://my.router:1027/version 92 | # http://ip:port/version 93 | 94 | # 在线激活方式:注册界面选择授权服务器(license server),点击多几次“Discover server”(自动发现配置),然后点击“OK” 。 95 | # 或手动填写 http://my.router:1027 或 http://路由ip:1027 ,然后点击“OK” 96 | 97 | sed -Ei '/txt-record=_jetbrains-license-server.lan/d' /etc/storage/dnsmasq/dnsmasq.conf 98 | nvram set lan_domain="lan" 99 | lan_ipaddr=`nvram get lan_ipaddr` 100 | echo "txt-record=_jetbrains-license-server.lan,url=http://$lan_ipaddr:1027" >> /etc/storage/dnsmasq/dnsmasq.conf 101 | killall jblicsvr 102 | jblicsvr -d -p 1027 2>&1 & 103 | restart_dhcpd 104 | 105 | EEE 106 | chmod 755 "$jbls_script" 107 | fi 108 | 109 | } 110 | 111 | #initconfig 112 | 113 | case $ACTION in 114 | start) 115 | jbls_close 116 | jbls_check 117 | ;; 118 | check) 119 | jbls_check 120 | ;; 121 | stop) 122 | jbls_close 123 | ;; 124 | keep) 125 | #jbls_check 126 | jbls_keep 127 | ;; 128 | *) 129 | jbls_check 130 | ;; 131 | esac 132 | 133 | -------------------------------------------------------------------------------- /script/Sh04_mento_hust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | mentohust_enable=`nvram get mentohust_enable` 5 | [ -z $mentohust_enable ] && mentohust_enable=0 && nvram set mentohust_enable=0 6 | if [ "$mentohust_enable" != "0" ] ; then 7 | mentohust_path=`nvram get mentohust_path` 8 | [ -z $mentohust_path ] && mentohust_path="/usr/bin/mentohust" && nvram set mentohust_path=$mentohust_path 9 | mentohust_n="$(nvram get mentohust_n)" 10 | [ "$mentohust_n" = "0" ] && mentohust_n="$(nvram get wan0_ifname_t)" && nvram set mentohust_n=$mentohust_n 11 | [ -z $mentohust_n ] && mentohust_n="$(nvram get wan0_ifname_t)" && nvram set mentohust_n=$mentohust_n 12 | mentohust_i=`nvram get mentohust_i` 13 | [ -z $mentohust_i ] && mentohust_i="0.0.0.0" && nvram set mentohust_i=$mentohust_i 14 | mentohust_m=`nvram get mentohust_m` 15 | [ -z $mentohust_m ] && mentohust_m=$(nvram get lan_netmask) && nvram set mentohust_m=$mentohust_m 16 | mentohust_g=`nvram get mentohust_g` 17 | [ -z $mentohust_g ] && mentohust_g="0.0.0.0" && nvram set mentohust_g=$mentohust_g 18 | mentohust_s=`nvram get mentohust_s` 19 | [ -z $mentohust_s ] && mentohust_s="0.0.0.0" && nvram set mentohust_s=$mentohust_s 20 | mentohust_o=`nvram get mentohust_o` 21 | [ -z $mentohust_o ] && mentohust_o="0.0.0.0" && nvram set mentohust_o=$mentohust_o 22 | mentohust_t=`nvram get mentohust_t` 23 | [ -z $mentohust_t ] && mentohust_t="8" && nvram set mentohust_t=$mentohust_t 24 | mentohust_e=`nvram get mentohust_e` 25 | [ -z $mentohust_e ] && mentohust_e="30" && nvram set mentohust_e=$mentohust_e 26 | mentohust_r=`nvram get mentohust_r` 27 | [ -z $mentohust_r ] && mentohust_r="15" && nvram set mentohust_r=$mentohust_r 28 | mentohust_l=`nvram get mentohust_l` 29 | [ -z $mentohust_l ] && mentohust_l="8" && nvram set mentohust_l=$mentohust_l 30 | mentohust_a=`nvram get mentohust_a` 31 | [ -z $mentohust_a ] && mentohust_a="0" && nvram set mentohust_a=$mentohust_a 32 | mentohust_d=`nvram get mentohust_d` 33 | [ -z $mentohust_d ] && mentohust_d="0" && nvram set mentohust_d=$mentohust_d 34 | mentohust_b=`nvram get mentohust_b` 35 | [ -z $mentohust_b ] && mentohust_b="0" && nvram set mentohust_b=$mentohust_b 36 | mentohust_v=`nvram get mentohust_v` 37 | [ -z $mentohust_v ] && mentohust_v="0.00" && nvram set mentohust_v=$mentohust_v 38 | mentohust_c=`nvram get mentohust_c` 39 | [ -z $mentohust_c ] && mentohust_c="dhclinet" && nvram set mentohust_c=$mentohust_c 40 | mentohust_f=`nvram get mentohust_f` 41 | mentohust_u=`nvram get mentohust_u` 42 | mentohust_p=`nvram get mentohust_p` 43 | mentohust_mode=`nvram get mentohust_mode` 44 | mentohust_renum=`nvram get mentohust_renum` 45 | mentohust_renum=${mentohust_renum:-"0"} 46 | cmd_log_enable=`nvram get cmd_log_enable` 47 | cmd_name="MentoHUST" 48 | cmd_log="" 49 | if [ "$cmd_log_enable" = "1" ] || [ "$mentohust_renum" -gt "0" ] ; then 50 | cmd_log="$cmd_log2" 51 | fi 52 | fi 53 | 54 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep mento_hust)" ] && [ ! -s /tmp/script/_mento_hust ] ; then 55 | mkdir -p /tmp/script 56 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_mento_hust 57 | chmod 777 /tmp/script/_mento_hust 58 | fi 59 | 60 | mentohust_restart () { 61 | i_app_restart "$@" -name="mentohust" 62 | } 63 | 64 | mentohust_get_status () { 65 | 66 | B_restart="$mentohust_enable$mentohust_path$mentohust_u$mentohust_p$mentohust_n$mentohust_i$mentohust_m$mentohust_g$mentohust_s$mentohust_o$mentohust_t$mentohust_e$mentohust_r$mentohust_a$mentohust_d$mentohust_b$mentohust_v$mentohust_f$mentohust_c$mentohust_mode" 67 | 68 | i_app_get_status -name="mentohust" -valb="$B_restart" 69 | } 70 | 71 | mentohust_check () { 72 | 73 | mentohust_get_status 74 | if [ "$mentohust_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 75 | [ ! -z "`pidof mentohust`" ] && logger -t "【MentoHUST】" "停止 mentohust" && mentohust_close 76 | { kill_ps "$scriptname" exit0; exit 0; } 77 | fi 78 | if [ "$mentohust_enable" = "1" ] ; then 79 | if [ "$needed_restart" = "1" ] ; then 80 | #配置有变,重新生成 81 | rm -f /etc/storage/mentohust.conf 82 | mentohust_close 83 | mentohust_start 84 | else 85 | [ -z "`pidof mentohust`" ] && mentohust_restart 86 | fi 87 | fi 88 | } 89 | 90 | mentohust_keep () { 91 | i_app_keep -t -name="mentohust" -pidof="$(basename $mentohust_path)" -cpath="$mentohust_path" 92 | i_app_keep -name="mentohust" -pidof="$(basename $mentohust_path)" -cpath="$mentohust_path" & 93 | } 94 | 95 | mentohust_close () { 96 | kill_ps "$scriptname keep" 97 | sed -Ei '/【mentohust】|^$/d' /tmp/script/_opt_script_check 98 | killall mentohust 99 | kill_ps "/tmp/script/_mento_hust" 100 | kill_ps "_mento_hust.sh" 101 | kill_ps "$scriptname" 102 | } 103 | 104 | mentohust_start () { 105 | 106 | #check_webui_yes 107 | i_app_get_cmd_file -name="mentohust" -cmd="$mentohust_path" -cpath="/opt/bin/mentohust" -down1="$hiboyfile/mentohust" -down2="$hiboyfile2/mentohust" 108 | [ -s "$SVC_PATH" ] && [ "$(nvram get mentohust_path)" != "$SVC_PATH" ] && nvram set mentohust_path="$SVC_PATH" 109 | mentohust_path="$SVC_PATH" 110 | 111 | logger -t "【MentoHUST】" "运行 $mentohust_path" 112 | 113 | #保存配置到文件 114 | if [ ! -f "/etc/storage/mentohust.conf" ] ; then 115 | $mentohust_path -u$mentohust_u -p$mentohust_p -n$mentohust_n -i$mentohust_i -m$mentohust_m -g$mentohust_g -s$mentohust_s -o$mentohust_o -t$mentohust_t -e$mentohust_e -r$mentohust_r -l$mentohust_l -a$mentohust_a -d$mentohust_d -b$mentohust_b -v$mentohust_v -f$mentohust_f -c$mentohust_c -w 116 | sleep 2 117 | pids=$(pidof process) && killall process 118 | fi 119 | mentohust_mode=`nvram get mentohust_mode` 120 | if [ "$mentohust_mode" = "0" ] ; then 121 | logger -t "【MentoHUST】" "标准模式" 122 | eval "$mentohust_path $cmd_log" & 123 | elif [ "$mentohust_mode" = "1" ] ; then 124 | logger -t "【MentoHUST】" "锐捷模式" 125 | eval "$mentohust_path -y $cmd_log" & 126 | elif [ "$mentohust_mode" = "2" ] ; then 127 | logger -t "【MentoHUST】" "赛尔模式" 128 | eval "$mentohust_path -s8.8.8.8 $cmd_log" & 129 | fi 130 | sleep 4 131 | #restart_firewall 132 | #mentohust_get_status 133 | eval "$scriptfilepath keep &" 134 | exit 0 135 | } 136 | 137 | case $ACTION in 138 | start) 139 | mentohust_close 140 | mentohust_check 141 | ;; 142 | check) 143 | mentohust_check 144 | ;; 145 | stop) 146 | mentohust_close 147 | ;; 148 | keep) 149 | #mentohust_check 150 | mentohust_keep 151 | ;; 152 | *) 153 | mentohust_check 154 | ;; 155 | esac 156 | 157 | -------------------------------------------------------------------------------- /script/Sh19_chinadns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "Sh19_chinadns" -------------------------------------------------------------------------------- /script/Sh21_mproxy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | mproxyport=`nvram get mproxyport` 5 | mproxy_enable=`nvram get mproxy_enable` 6 | [ -z $mproxy_enable ] && mproxy_enable=0 && nvram set mproxy_enable=0 7 | if [ "$mproxy_enable" != "0" ] ; then 8 | mproxy_port=`nvram get mproxy_port` 9 | mproxy_renum=`nvram get mproxy_renum` 10 | mproxy_renum=${mproxy_renum:-"0"} 11 | cmd_log_enable=`nvram get cmd_log_enable` 12 | cmd_name="mproxy" 13 | cmd_log="" 14 | if [ "$cmd_log_enable" = "1" ] || [ "$mproxy_renum" -gt "0" ] ; then 15 | cmd_log="$cmd_log2" 16 | fi 17 | fi 18 | 19 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep mproxy)" ] && [ ! -s /tmp/script/_mproxy ] ; then 20 | mkdir -p /tmp/script 21 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_mproxy 22 | chmod 777 /tmp/script/_mproxy 23 | fi 24 | 25 | mproxy_restart () { 26 | i_app_restart "$@" -name="mproxy" 27 | } 28 | 29 | mproxy_get_status () { 30 | 31 | B_restart="$mproxy_enable$mproxy_port$(cat /etc/storage/mproxy_script.sh | grep -v '^#' | grep -v '^$')" 32 | 33 | i_app_get_status -name="mproxy" -valb="$B_restart" 34 | } 35 | 36 | mproxy_check () { 37 | 38 | mproxy_get_status 39 | if [ "$mproxy_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 40 | [ ! -z "`pidof mproxy`" ] && logger -t "【mproxy】" "停止 mproxy" && mproxy_close 41 | { kill_ps "$scriptname" exit0; exit 0; } 42 | fi 43 | if [ "$mproxy_enable" = "1" ] ; then 44 | if [ "$needed_restart" = "1" ] ; then 45 | mproxy_close 46 | mproxy_start 47 | else 48 | [ -z "`pidof mproxy`" ] && mproxy_restart 49 | mproxy_port_dpt 50 | fi 51 | fi 52 | } 53 | 54 | mproxy_keep () { 55 | i_app_keep -name="mproxy" -pidof="mproxy" & 56 | } 57 | 58 | mproxy_close () { 59 | 60 | kill_ps "$scriptname keep" 61 | sed -Ei '/【mproxy】|^$/d' /tmp/script/_opt_script_check 62 | mproxyport=$(echo `cat /etc/storage/mproxy_script.sh | grep -v '^#' | grep "mproxy_port=" | sed 's/mproxy_port=//'`) 63 | [ ! -z "$mproxyport" ] && iptables -t filter -D INPUT -p tcp --dport $mproxyport -j ACCEPT 64 | killall mproxy mproxy_script.sh 65 | kill_ps "/tmp/script/_mproxy" 66 | kill_ps "_mproxy.sh" 67 | kill_ps "$scriptname" 68 | } 69 | 70 | mproxy_start () { 71 | check_webui_yes 72 | i_app_get_cmd_file -name="mproxy" -cmd="mproxy" -cpath="/opt/bin/mproxy" -down1="$hiboyfile/mproxy" -down2="$hiboyfile2/mproxy" 73 | logger -t "【mproxy】" "运行 mproxy_script" 74 | eval "/etc/storage/mproxy_script.sh $cmd_log" & 75 | restart_on_dhcpd 76 | sleep 4 77 | i_app_keep -t -name="mproxy" -pidof="mproxy" 78 | mproxy_port_dpt 79 | #mproxy_get_status 80 | eval "$scriptfilepath keep &" 81 | exit 0 82 | } 83 | 84 | initconfig () { 85 | 86 | config_mproxy="/etc/storage/mproxy_script.sh" 87 | if [ ! -f "$config_mproxy" ] || [ ! -s "$config_mproxy" ] ; then 88 | cat > "$config_mproxy" <<-\END 89 | #!/bin/bash 90 | killall mproxy 91 | logger -t "【mproxy】" "运行 mproxy" 92 | # 使用方法:https://github.com/examplecode/mproxy 93 | # 本地监听端口 94 | mproxy_port=8000 95 | 96 | # 删除(#)启用指定选项 97 | # 默认作为普通的代理服务器。 98 | mproxy -l $mproxy_port -d 2>&1 & 99 | 100 | 101 | 102 | # 在远程服务器启动mproxy作为远程代理 103 | # 在远程作为加密代传输方式理服务器 104 | # mproxy -l 8081 -D -d 2>&1 & 105 | 106 | 107 | # 本地启动 mproxy 作为本地代理,并指定传输方式加密。 108 | # 在本地启动一个mporxy 并指定目上一步在远程部署的服务器地址和端口号。 109 | # mproxy -l 8080 -h xxx.xxx.xxx.xxx:8081 -E 2>&1 & 110 | 111 | 112 | END 113 | fi 114 | chmod 777 "$config_mproxy" 115 | 116 | } 117 | 118 | initconfig 119 | 120 | mproxy_port_dpt () { 121 | 122 | if [ "$mproxy_port" = "1" ] ; then 123 | mproxyport=$(echo `cat /etc/storage/mproxy_script.sh | grep -v '^#' | grep "mproxy_port=" | sed 's/mproxy_port=//'`) 124 | [ ! -z "$mproxyport" ] && port=$(iptables -t filter -L INPUT -v -n --line-numbers | grep dpt:$mproxyport | cut -d " " -f 1 | sort -nr | wc -l) 125 | if [ ! -z "$mproxyport" ] && [ "$port" = 0 ] ; then 126 | [ ! -z "$mproxyport" ] && logger -t "【mproxy】" "允许 $mproxyport 端口通过防火墙" 127 | [ ! -z "$mproxyport" ] && iptables -t filter -I INPUT -p tcp --dport $mproxyport -j ACCEPT 128 | fi 129 | fi 130 | 131 | } 132 | 133 | case $ACTION in 134 | start) 135 | mproxy_close 136 | mproxy_check 137 | ;; 138 | check) 139 | mproxy_check 140 | ;; 141 | stop) 142 | mproxy_close 143 | ;; 144 | keep) 145 | #mproxy_check 146 | mproxy_keep 147 | ;; 148 | *) 149 | mproxy_check 150 | ;; 151 | esac 152 | 153 | -------------------------------------------------------------------------------- /script/Sh22_tinyproxy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | tinyproxy_enable=`nvram get tinyproxy_enable` 5 | [ -z $tinyproxy_enable ] && tinyproxy_enable=0 && nvram set tinyproxy_enable=0 6 | tinyproxy_path=`nvram get tinyproxy_path` 7 | [ -z $tinyproxy_path ] && tinyproxy_path=`which tinyproxy` && nvram set tinyproxy_path="$tinyproxy_path" 8 | [ ! -s "$tinyproxy_path" ] && tinyproxy_path="/usr/sbin/tinyproxy" && nvram set tinyproxy_path="/usr/sbin/tinyproxy" 9 | if [ "$tinyproxy_enable" != "0" ] ; then 10 | tinyproxy_port=`nvram get tinyproxy_port` 11 | tinyproxy_renum=`nvram get tinyproxy_renum` 12 | tinyproxy_renum=${tinyproxy_renum:-"0"} 13 | cmd_log_enable=`nvram get cmd_log_enable` 14 | cmd_name="tinyproxy" 15 | cmd_log="" 16 | if [ "$cmd_log_enable" = "1" ] || [ "$tinyproxy_renum" -gt "0" ] ; then 17 | cmd_log="$cmd_log2" 18 | fi 19 | fi 20 | 21 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep tinyproxy)" ] && [ ! -s /tmp/script/_tinyproxy ] ; then 22 | mkdir -p /tmp/script 23 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_tinyproxy 24 | chmod 777 /tmp/script/_tinyproxy 25 | fi 26 | 27 | tinyproxy_restart () { 28 | i_app_restart "$@" -name="tinyproxy" 29 | } 30 | 31 | tinyproxy_get_status () { 32 | 33 | B_restart="$tinyproxy_enable$tinyproxy_path$tinyproxy_port$(cat /etc/storage/tinyproxy_script.sh | grep -v '^#' | grep -v '^$')" 34 | 35 | i_app_get_status -name="tinyproxy" -valb="$B_restart" 36 | } 37 | 38 | tinyproxy_check () { 39 | 40 | tinyproxy_get_status 41 | if [ "$tinyproxy_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 42 | [ ! -z "$(ps -w | grep "$tinyproxy_path" | grep -v grep )" ] && logger -t "【tinyproxy】" "停止 $tinyproxy_path" && tinyproxy_close 43 | { kill_ps "$scriptname" exit0; exit 0; } 44 | fi 45 | if [ "$tinyproxy_enable" = "1" ] ; then 46 | if [ "$needed_restart" = "1" ] ; then 47 | tinyproxy_close 48 | tinyproxy_start 49 | else 50 | [ -z "$(ps -w | grep "$tinyproxy_path" | grep -v grep )" ] && tinyproxy_restart 51 | tinyproxy_port_dpt 52 | fi 53 | fi 54 | } 55 | 56 | tinyproxy_keep () { 57 | i_app_keep -name="tinyproxy" -pidof="$(basename $tinyproxy_path)" -cpath="$tinyproxy_path" & 58 | } 59 | 60 | tinyproxy_close () { 61 | 62 | kill_ps "$scriptname keep" 63 | sed -Ei '/【tinyproxy】|^$/d' /tmp/script/_opt_script_check 64 | tinyproxyport=$(echo `cat /etc/storage/tinyproxy_script.sh | grep -v '^#' | grep -v "ConnectPort" | grep "Port" | sed 's/Port//'`) 65 | [ ! -z "$tinyproxyport" ] && iptables -t filter -D INPUT -p tcp --dport $tinyproxyport -j ACCEPT 66 | killall tinyproxy tinyproxy_script.sh 67 | [ ! -z "$tinyproxy_path" ] && kill_ps "$tinyproxy_path" 68 | kill_ps "/tmp/script/_tinyproxy" 69 | kill_ps "_tinyproxy.sh" 70 | kill_ps "$scriptname" 71 | } 72 | 73 | tinyproxy_start () { 74 | check_webui_yes 75 | i_app_get_cmd_file -name="tinyproxy" -cmd="$tinyproxy_path" -cpath="/opt/bin/tinyproxy" -down1="$hiboyfile/tinyproxy" -down2="$hiboyfile2/tinyproxy" 76 | [ -s "$SVC_PATH" ] && [ "$(nvram get tinyproxy_path)" != "$SVC_PATH" ] && nvram set tinyproxy_path="$SVC_PATH" 77 | tinyproxy_path="$SVC_PATH" 78 | logger -t "【tinyproxy】" "运行 $tinyproxy_path" 79 | eval "$tinyproxy_path -c /etc/storage/tinyproxy_script.sh $cmd_log" & 80 | restart_on_dhcpd 81 | sleep 4 82 | i_app_keep -t -name="tinyproxy" -pidof="$(basename $tinyproxy_path)" -cpath="$tinyproxy_path" 83 | tinyproxy_port_dpt 84 | tinyproxy_get_status 85 | eval "$scriptfilepath keep &" 86 | exit 0 87 | } 88 | 89 | initconfig () { 90 | 91 | config_tinyproxy="/etc/storage/tinyproxy_script.sh" 92 | if [ ! -f "$config_tinyproxy" ] || [ ! -s "$config_tinyproxy" ] ; then 93 | cat > "$config_tinyproxy" <<-\END 94 | ## tinyproxy.conf -- tinyproxy daemon configuration file 95 | ## https://github.com/tinyproxy/tinyproxy/blob/master/etc/tinyproxy.conf.in 96 | #User nobody 97 | #Group nobody 98 | Port 9999 99 | #Listen 192.168.0.1 #注释之后可以侦听所有网卡的请求 100 | #Bind 192.168.0.1 101 | Timeout 600 102 | # DefaultErrorFile "/usr/local/share/tinyproxy/default.html" 103 | # StatFile "/usr/local/share/tinyproxy/stats.html" 104 | Logfile "/tmp/syslog.log" 105 | LogLevel Info 106 | PidFile "/var/run/tinyproxy.pid" 107 | MaxClients 100 108 | MinSpareServers 5 109 | MaxSpareServers 20 110 | StartServers 10 111 | MaxRequestsPerChild 0 112 | # Allow 127.0.0.1 113 | ViaProxyName "tinyproxy" 114 | # This is a list of ports allowed by tinyproxy when the CONNECT method 115 | # is used. To disable the CONNECT method altogether, set the value to 0. 116 | # If no ConnectPort line is found, all ports are allowed (which is not 117 | # very secure.) 118 | # 119 | # The following two ports are used by SSL. 120 | # 121 | ConnectPort 443 122 | ConnectPort 563 123 | 124 | END 125 | fi 126 | 127 | } 128 | 129 | initconfig 130 | 131 | 132 | tinyproxy_port_dpt () { 133 | 134 | if [ "$tinyproxy_port" = "1" ] ; then 135 | tinyproxyport=$(echo `cat /etc/storage/tinyproxy_script.sh | grep -v '^#' | grep -v "ConnectPort" | grep "Port" | sed 's/Port//'`) 136 | [ ! -z "$tinyproxyport" ] && port=$(iptables -t filter -L INPUT -v -n --line-numbers | grep dpt:$tinyproxyport | cut -d " " -f 1 | sort -nr | wc -l) 137 | if [ ! -z "$tinyproxyport" ] && [ "$port" = 0 ] ; then 138 | [ ! -z "$tinyproxyport" ] && logger -t "【tinyproxy】" "允许 $tinyproxyport 端口通过防火墙" 139 | [ ! -z "$tinyproxyport" ] && iptables -t filter -I INPUT -p tcp --dport $tinyproxyport -j ACCEPT 140 | fi 141 | fi 142 | 143 | } 144 | 145 | case $ACTION in 146 | start) 147 | tinyproxy_close 148 | tinyproxy_check 149 | ;; 150 | check) 151 | tinyproxy_check 152 | ;; 153 | stop) 154 | tinyproxy_close 155 | ;; 156 | keep) 157 | #tinyproxy_check 158 | tinyproxy_keep 159 | ;; 160 | *) 161 | tinyproxy_check 162 | ;; 163 | esac 164 | 165 | -------------------------------------------------------------------------------- /script/Sh23_vpnproxy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | vpnproxy_wan_port=`nvram get vpnproxy_wan_port` 5 | vpnproxy_enable=`nvram get vpnproxy_enable` 6 | [ -z $vpnproxy_enable ] && vpnproxy_enable=0 && nvram set vpnproxy_enable=0 7 | if [ "$vpnproxy_enable" != "0" ] ; then 8 | vpnproxy_vpn_port=`nvram get vpnproxy_vpn_port` 9 | vpnproxy_renum=`nvram get vpnproxy_renum` 10 | vpnproxy_renum=${vpnproxy_renum:-"0"} 11 | cmd_log_enable=`nvram get cmd_log_enable` 12 | cmd_name="vpnproxy" 13 | cmd_log="" 14 | if [ "$cmd_log_enable" = "1" ] || [ "$vpnproxy_renum" -gt "0" ] ; then 15 | cmd_log="$cmd_log2" 16 | fi 17 | fi 18 | 19 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep vpnproxy)" ] && [ ! -s /tmp/script/_vpnproxy ] ; then 20 | mkdir -p /tmp/script 21 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_vpnproxy 22 | chmod 777 /tmp/script/_vpnproxy 23 | fi 24 | 25 | vpnproxy_restart () { 26 | i_app_restart "$@" -name="vpnproxy" 27 | } 28 | 29 | vpnproxy_get_status () { 30 | 31 | [ -z $vpnproxy_wan_port ] && vpnproxy_wan_port=8888 && nvram set vpnproxy_wan_port=$vpnproxy_wan_port 32 | [ -z $vpnproxy_vpn_port ] && vpnproxy_vpn_port=1194 && nvram set vpnproxy_vpn_port=$vpnproxy_vpn_port 33 | B_restart="$vpnproxy_enable$vpnproxy_wan_port$vpnproxy_vpn_port" 34 | 35 | i_app_get_status -name="vpnproxy" -valb="$B_restart" 36 | } 37 | 38 | vpnproxy_check () { 39 | 40 | vpnproxy_get_status 41 | if [ "$vpnproxy_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 42 | [ ! -z "`pidof nvpproxy`" ] && logger -t "【vpnproxy】" "停止 nvpproxy" && vpnproxy_close 43 | { kill_ps "$scriptname" exit0; exit 0; } 44 | fi 45 | if [ "$vpnproxy_enable" = "1" ] ; then 46 | if [ "$needed_restart" = "1" ] ; then 47 | vpnproxy_close 48 | vpnproxy_start 49 | else 50 | [ -z "`pidof nvpproxy`" ] && vpnproxy_restart 51 | vpnproxy_port_dpt 52 | fi 53 | fi 54 | } 55 | 56 | vpnproxy_keep () { 57 | i_app_keep -name="vpnproxy" -pidof="nvpproxy" & 58 | } 59 | 60 | vpnproxy_close () { 61 | 62 | kill_ps "$scriptname keep" 63 | sed -Ei '/【vpnproxy】|^$/d' /tmp/script/_opt_script_check 64 | iptables -t filter -D INPUT -p tcp --dport $vpnproxy_wan_port -j ACCEPT 65 | killall nvpproxy 66 | kill_ps "/tmp/script/_vpnproxy" 67 | kill_ps "_vpnproxy.sh" 68 | kill_ps "$scriptname" 69 | } 70 | 71 | vpnproxy_start () { 72 | check_webui_yes 73 | i_app_get_cmd_file -name="vpnproxy" -cmd="nvpproxy" -cpath="/opt/bin/nvpproxy" -down1="$hiboyfile/nvpproxy" -down2="$hiboyfile2/nvpproxy" 74 | logger -t "【vpnproxy】" "运行 $SVC_PATH" 75 | eval "nvpproxy -port=$vpnproxy_wan_port -proxy=127.0.0.1:$vpnproxy_vpn_port $cmd_log" & 76 | restart_on_dhcpd 77 | sleep 4 78 | i_app_keep -t -name="vpnproxy" -pidof="nvpproxy" 79 | vpnproxy_port_dpt 80 | #vpnproxy_get_status 81 | eval "$scriptfilepath keep &" 82 | exit 0 83 | } 84 | 85 | vpnproxy_port_dpt () { 86 | 87 | port=$(iptables -t filter -L INPUT -v -n --line-numbers | grep dpt:$vpnproxy_wan_port | cut -d " " -f 1 | sort -nr | wc -l) 88 | if [ "$port" = 0 ] ; then 89 | logger -t "【vpnproxy】" "允许 $vpnproxy_wan_port 端口通过防火墙" 90 | iptables -t filter -I INPUT -p tcp --dport $vpnproxy_wan_port -j ACCEPT 91 | fi 92 | 93 | } 94 | 95 | case $ACTION in 96 | start) 97 | vpnproxy_close 98 | vpnproxy_check 99 | ;; 100 | check) 101 | vpnproxy_check 102 | ;; 103 | stop) 104 | vpnproxy_close 105 | ;; 106 | keep) 107 | #vpnproxy_check 108 | vpnproxy_keep 109 | ;; 110 | *) 111 | vpnproxy_check 112 | ;; 113 | esac 114 | 115 | -------------------------------------------------------------------------------- /script/Sh25_softether.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | softether_enable=`nvram get softether_enable` 5 | [ -z $softether_enable ] && softether_enable=0 && nvram set softether_enable=0 6 | softether_path=`nvram get softether_path` 7 | [ -z $softether_path ] && softether_path="/opt/softether/vpnserver" && nvram set softether_path=$softether_path 8 | softether_renum=`nvram get softether_renum` 9 | softether_renum=${softether_renum:-"0"} 10 | cmd_log_enable=`nvram get cmd_log_enable` 11 | cmd_name="softether" 12 | cmd_log="" 13 | if [ "$cmd_log_enable" = "1" ] || [ "$softether_renum" -gt "0" ] ; then 14 | cmd_log="$cmd_log2" 15 | fi 16 | 17 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep softether)" ] && [ ! -s /tmp/script/_softether ] ; then 18 | mkdir -p /tmp/script 19 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_softether 20 | chmod 777 /tmp/script/_softether 21 | fi 22 | 23 | softether_restart () { 24 | i_app_restart "$@" -name="softether" 25 | } 26 | 27 | softether_get_status () { 28 | 29 | B_restart="$softether_enable$softether_path$(cat /etc/storage/softether_script.sh | grep -v '^#' | grep -v '^$')" 30 | 31 | i_app_get_status -name="softether" -valb="$B_restart" 32 | } 33 | 34 | softether_check () { 35 | 36 | softether_get_status 37 | if [ "$softether_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 38 | [ ! -z "$(ps -w | grep "$softether_path" | grep -v grep )" ] && logger -t "【softether】" "停止 softether" && softether_close 39 | { kill_ps "$scriptname" exit0; exit 0; } 40 | fi 41 | if [ "$softether_enable" = "1" ] ; then 42 | if [ "$needed_restart" = "1" ] ; then 43 | softether_close 44 | softether_start 45 | else 46 | [ -z "$(ps -w | grep "$softether_path" | grep -v grep )" ] && softether_restart 47 | softether_port_dpt 48 | fi 49 | fi 50 | } 51 | 52 | softether_keep () { 53 | i_app_keep -name="softether" -pidof="$(basename $softether_path)" -cpath="$softether_path" & 54 | } 55 | 56 | softether_close () { 57 | 58 | kill_ps "$scriptname keep" 59 | sed -Ei '/【softether】|^$/d' /tmp/script/_opt_script_check 60 | iptables -t filter -D INPUT -p udp --destination-port 500 -j ACCEPT 61 | iptables -t filter -D INPUT -p udp --destination-port 4500 -j ACCEPT 62 | iptables -t filter -D INPUT -p udp --destination-port 1701 -j ACCEPT 63 | [ ! -z "$softether_path" ] && $softether_path stop 64 | [ ! -z "$softether_path" ] && kill_ps "$softether_path" 65 | killall vpnserver softether_script.sh 66 | rm -f /etc/storage/dnsmasq/dnsmasq.d/softether.conf 67 | restart_on_dhcpd 68 | kill_ps "/tmp/script/_softether" 69 | kill_ps "_softether.sh" 70 | kill_ps "$scriptname" 71 | } 72 | 73 | softether_start () { 74 | check_webui_yes 75 | i_app_get_cmd_file -name="softether" -cmd="$softether_path" -cpath="/opt/softether/vpnserver" -down1="$hiboyfile/vpnserver" -down2="$hiboyfile2/vpnserver" 76 | softether_path="$SVC_PATH" 77 | [ -s "$SVC_PATH" ] && [ "$(nvram get softether_path)" != "$SVC_PATH" ] && nvram set softether_path="$SVC_PATH" 78 | i_app_get_cmd_file -name="softether" -cmd="$(dirname $softether_path)/vpncmd" -cpath="/opt/softether/vpncmd" -down1="$hiboyfile/vpncmd" -down2="$hiboyfile2/vpncmd" -runh="x" 79 | if [ ! -s "$(dirname $softether_path)/hamcore.se2" ] ; then 80 | wgetcurl_checkmd5 "$(dirname $softether_path)/hamcore.se2" "$hiboyfile/hamcore.se2" "$hiboyfile2/hamcore.se2" N 81 | fi 82 | logger -t "【softether】" "运行 softether_script" 83 | $softether_path stop 84 | eval "/etc/storage/softether_script.sh $cmd_log" & 85 | sleep 4 86 | i_app_keep -t -name="softether" -pidof="$(basename $softether_path)" -cpath="$softether_path" 87 | 88 | softether_port_dpt 89 | softether_get_status 90 | eval "$scriptfilepath keep &" 91 | exit 0 92 | } 93 | 94 | initconfig () { 95 | 96 | if [ ! -f "/etc/storage/softether_script.sh" ] || [ ! -s "/etc/storage/softether_script.sh" ] ; then 97 | cat > "/etc/storage/softether_script.sh" <<-\FOF 98 | #!/bin/bash 99 | export PATH='/opt/softether:/etc/storage/bin:/tmp/script:/etc/storage/script:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin' 100 | export LD_LIBRARY_PATH=/lib:/opt/lib 101 | source /etc/storage/script/init.sh 102 | softether_path=`nvram get softether_path` 103 | [ -z $softether_path ] && softether_path=`which vpnserver` && nvram set softether_path=$softether_path 104 | SVC_PATH=$softether_path 105 | [ -f /opt/softether/vpn_server.config ] && [ ! -f /etc/storage/vpn_server.config ] && cp -f /opt/softether/vpn_server.config /etc/storage/vpn_server.config 106 | [ ! -f /etc/storage/vpn_server.config ] && touch /etc/storage/vpn_server.config 107 | ln -sf /etc/storage/vpn_server.config /opt/softether/vpn_server.config 108 | [ ! -s /opt/softether/vpn_server.config ] && cp -f /etc/storage/vpn_server.config /opt/softether/vpn_server.config 109 | $SVC_PATH start 2>&1 & 110 | tap="" 111 | until [ ! -z "$tap" ] 112 | do 113 | tap=`ifconfig | grep tap_ | awk '{print $1}'` 114 | sleep 2 115 | done 116 | logger -t "【softether】" "正确启动 vpnserver!" 117 | brctl addif br0 $tap 118 | echo interface=$tap > /etc/storage/dnsmasq/dnsmasq.d/softether.conf 119 | restart_dhcpd 120 | mtd_storage.sh save & 121 | FOF 122 | chmod 777 "/etc/storage/softether_script.sh" 123 | fi 124 | 125 | } 126 | 127 | initconfig 128 | 129 | softether_port_dpt () { 130 | 131 | port=$(iptables -t filter -L INPUT -v -n --line-numbers | grep dpt:500 | cut -d " " -f 1 | sort -nr | wc -l) 132 | if [ "$port" = 0 ] ; then 133 | logger -t "【softether】" "允许 500、4500、1701 udp端口通过防火墙" 134 | iptables -t filter -I INPUT -p udp --destination-port 500 -j ACCEPT 135 | iptables -t filter -I INPUT -p udp --destination-port 4500 -j ACCEPT 136 | iptables -t filter -I INPUT -p udp --destination-port 1701 -j ACCEPT 137 | fi 138 | 139 | } 140 | 141 | case $ACTION in 142 | start) 143 | softether_close 144 | softether_check 145 | ;; 146 | check) 147 | softether_check 148 | ;; 149 | stop) 150 | softether_close 151 | ;; 152 | keep) 153 | #softether_check 154 | softether_keep 155 | ;; 156 | *) 157 | softether_check 158 | ;; 159 | esac 160 | 161 | -------------------------------------------------------------------------------- /script/Sh27_speedup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 失效清理 3 | echo "Sh27_speedup" -------------------------------------------------------------------------------- /script/Sh28_guest_kit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | guestkit_enable=`nvram get app_26` 5 | [ -z $guestkit_enable ] && guestkit_enable=0 && nvram set app_26=0 6 | 7 | guestkit_renum=`nvram get guestkit_renum` 8 | guestkit_renum=${guestkit_renum:-"0"} 9 | cmd_log_enable=`nvram get cmd_log_enable` 10 | cmd_name="guestkit" 11 | cmd_log="" 12 | if [ "$cmd_log_enable" = "1" ] || [ "$guestkit_renum" -gt "0" ] ; then 13 | cmd_log="$cmd_log2" 14 | fi 15 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep guest_kit)" ] && [ ! -s /tmp/script/_app9 ] ; then 16 | mkdir -p /tmp/script 17 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app9 18 | chmod 777 /tmp/script/_app9 19 | fi 20 | 21 | guestkit_restart () { 22 | i_app_restart "$@" -name="guestkit" 23 | } 24 | 25 | guestkit_get_status () { 26 | 27 | B_restart="$guestkit_enable$(cat /etc/storage/app_28.sh | grep -v '^#' | grep -v '^$')" 28 | 29 | i_app_get_status -name="guestkit" -valb="$B_restart" 30 | } 31 | 32 | guestkit_check () { 33 | 34 | guestkit_get_status 35 | if [ "$guestkit_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 36 | [ ! -z "`pidof guestkit`" ] && logger -t "【guestkit】" "停止 guestkit" && guestkit_close 37 | { kill_ps "$scriptname" exit0; exit 0; } 38 | fi 39 | if [ "$guestkit_enable" = "1" ] ; then 40 | if [ "$needed_restart" = "1" ] ; then 41 | guestkit_close 42 | guestkit_start 43 | else 44 | [ -z "`pidof guestkit`" ] && guestkit_restart 45 | guestkit_port_dpt 46 | fi 47 | fi 48 | } 49 | 50 | guestkit_keep () { 51 | i_app_keep -name="guestkit" -pidof="guestkit" & 52 | } 53 | 54 | guestkit_close () { 55 | 56 | kill_ps "$scriptname keep" 57 | sed -Ei '/【guestkit】|^$/d' /tmp/script/_opt_script_check 58 | iptables -t filter -D INPUT -p tcp --dport 7575 -j ACCEPT 59 | killall guestkit 60 | kill_ps "/tmp/script/_app9" 61 | kill_ps "_guest_kit.sh" 62 | kill_ps "$scriptname" 63 | } 64 | 65 | guestkit_start () { 66 | 67 | check_webui_yes 68 | i_app_get_cmd_file -name="guestkit" -cmd="guestkit" -cpath="/opt/bin/guestkit" -down1="$hiboyfile/guestkit" -down2="$hiboyfile2/guestkit" 69 | guestkit_v=$(guestkit -h | grep guestkit | sed -n '1p') 70 | nvram set guestkit_v="$guestkit_v" 71 | logger -t "【guestkit】" "运行 guestkit" 72 | 73 | #运行/opt/bin/guestkit 74 | cd $(dirname `which guestkit`) 75 | eval "guestkit $cmd_log" & 76 | sleep 7 77 | i_app_keep -t -name="guestkit" -pidof="guestkit" 78 | #guestkit_get_status 79 | eval "$scriptfilepath keep &" 80 | exit 0 81 | } 82 | 83 | initconfig () { 84 | 85 | app_28="/etc/storage/app_28.sh" 86 | if [ ! -f "$app_28" ] || [ ! -s "$app_28" ] ; then 87 | cat > "$app_28" <<-\EEE 88 | #!/bin/bash 89 | # 此脚本路径:/etc/storage/app_28.sh 90 | POST_DATA=`nvram get app_28_post` 91 | # 更多自定义命令请自行参考添加修改 92 | # "1" 数字是亮度值,当设定值匹配时运行代码,1-100可用 93 | if [ "$POST_DATA" = "1" ] ; then 94 | radio2_guest_enable 95 | radio5_guest_enable 96 | REPLY_DATA="打开网络" 97 | fi 98 | 99 | if [ "$POST_DATA" = "2" ] ; then 100 | radio2_guest_disable 101 | radio5_guest_disable 102 | REPLY_DATA="停用网络" 103 | fi 104 | 105 | if [ "$POST_DATA" = "3" ] ; then 106 | # 下面的00:00:00:00:00:00改为电脑网卡地址即可唤醒 107 | ether-wake -b -i br0 00:00:00:00:00:00 108 | REPLY_DATA="打开电脑" 109 | fi 110 | 111 | if [ "$POST_DATA" = "4" ] ; then 112 | nvram set ss_status=0 113 | nvram set ss_enable=1 114 | nvram commit 115 | /tmp/script/Sh15_ss.sh & 116 | REPLY_DATA="打开代理" 117 | fi 118 | 119 | if [ "$POST_DATA" = "5" ] ; then 120 | nvram set ss_status=1 121 | nvram set ss_enable=0 122 | nvram commit 123 | /tmp/script/Sh15_ss.sh & 124 | REPLY_DATA="关闭代理" 125 | fi 126 | 127 | if [ "$POST_DATA" = "6" ] ; then 128 | nvram commit 129 | /sbin/mtd_storage.sh save 130 | sync;echo 3 > /proc/sys/vm/drop_caches 131 | /bin/mtd_write -r unlock mtd1 #reboot 132 | REPLY_DATA="重启路由" 133 | fi 134 | 135 | if [ "$POST_DATA" = "7" ] ; then 136 | nvram set app_117=1 137 | nvram commit 138 | /etc/storage/script/Sh63_t_mall.sh & 139 | REPLY_DATA="打开路由" 140 | fi 141 | 142 | if [ "$POST_DATA" = "8" ] ; then 143 | nvram set app_117=0 144 | nvram commit 145 | /etc/storage/script/Sh63_t_mall.sh & 146 | REPLY_DATA="关闭路由" 147 | fi 148 | 149 | if [ "$POST_DATA" = "9" ] ; then 150 | /sbin/mtd_storage.sh reset 151 | nvram set restore_defaults=1 152 | nvram commit 153 | /sbin/mtd_storage.sh save 154 | sync;echo 3 > /proc/sys/vm/drop_caches 155 | /bin/mtd_write -r unlock mtd1 #reboot 156 | REPLY_DATA="重置路由" 157 | fi 158 | 159 | logger -t "【guestkit】" "运行 $POST_DATA $REPLY_DATA" 160 | 161 | EEE 162 | chmod 755 "$app_28" 163 | fi 164 | 165 | } 166 | 167 | initconfig 168 | 169 | update_app () { 170 | mkdir -p /opt/app/guestkit 171 | if [ "$1" = "update_asp" ] ; then 172 | rm -rf /opt/app/guestkit/Advanced_Extensions_guestkit.asp 173 | fi 174 | if [ "$1" = "del" ] ; then 175 | rm -rf /opt/app/guestkit/Advanced_Extensions_guestkit.asp 176 | [ -f /opt/bin/guestkit ] && rm -f /opt/bin/guestkit /opt/opt_backup/bin/guestkit 177 | rm -f /etc/storage/guestkit_db/* 178 | fi 179 | 180 | initconfig 181 | 182 | # 加载程序配置页面 183 | if [ ! -f "/opt/app/guestkit/Advanced_Extensions_guestkit.asp" ] || [ ! -s "/opt/app/guestkit/Advanced_Extensions_guestkit.asp" ] ; then 184 | wgetcurl.sh /opt/app/guestkit/Advanced_Extensions_guestkit.asp "$hiboyfile/Advanced_Extensions_guestkitasp" "$hiboyfile2/Advanced_Extensions_guestkitasp" 185 | fi 186 | umount /www/Advanced_Extensions_app09.asp 187 | mount --bind /opt/app/guestkit/Advanced_Extensions_guestkit.asp /www/Advanced_Extensions_app09.asp 188 | # 更新程序启动脚本 189 | 190 | [ "$1" = "del" ] && /etc/storage/www_sh/guestkit del & 191 | } 192 | 193 | case $ACTION in 194 | start) 195 | guestkit_close 196 | guestkit_check 197 | ;; 198 | check) 199 | guestkit_check 200 | ;; 201 | stop) 202 | guestkit_close 203 | ;; 204 | updateapp9) 205 | guestkit_restart o 206 | [ "$guestkit_enable" = "1" ] && nvram set guestkit_status="updateguestkit" && logger -t "【guestkit】" "重启" && guestkit_restart 207 | [ "$guestkit_enable" != "1" ] && nvram set guestkit_v="" && logger -t "【guestkit】" "更新" && update_app del 208 | ;; 209 | update_app) 210 | update_app 211 | ;; 212 | update_asp) 213 | update_app update_asp 214 | ;; 215 | keep) 216 | #guestkit_check 217 | guestkit_keep 218 | ;; 219 | initconfig) 220 | initconfig 221 | ;; 222 | *) 223 | guestkit_check 224 | ;; 225 | esac 226 | 227 | -------------------------------------------------------------------------------- /script/Sh31_orayd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | online="" 5 | orayslstatus="" 6 | SN="" 7 | STATUS="" 8 | szUID="" 9 | phddns=`nvram get phddns` 10 | [ -z $phddns ] && phddns=0 && nvram set phddns=0 11 | phddns_renum=`nvram get phddns_renum` 12 | phddns_renum=${phddns_renum:-"0"} 13 | cmd_log_enable=`nvram get cmd_log_enable` 14 | cmd_name="花生壳内网版" 15 | cmd_log=" >/dev/null 2>/dev/null " 16 | if [ "$cmd_log_enable" = "1" ] || [ "$phddns_renum" -gt "0" ] ; then 17 | cmd_log="$cmd_log2" 18 | fi 19 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep orayd)" ] && [ ! -s /tmp/script/_orayd ] ; then 20 | mkdir -p /tmp/script 21 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_orayd 22 | chmod 777 /tmp/script/_orayd 23 | fi 24 | 25 | phddns_restart () { 26 | i_app_restart "$@" -name="phddns" 27 | } 28 | 29 | phddns_check () { 30 | if [ "$phddns" != "1" ] ; then 31 | [ ! -z "`pidof oraysl`" ] && logger -t "【花生壳内网版】" "停止 oraysl" && phddns_close 32 | { kill_ps "$scriptname" exit0; exit 0; } 33 | fi 34 | if [ "$phddns" = "1" ] ; then 35 | if [ -z "`pidof oraysl`" ] || [ ! -s "`which oraysl`" ] ; then 36 | phddns_close 37 | phddns_start 38 | fi 39 | fi 40 | } 41 | 42 | onlinetest () { 43 | USER_DATA="/tmp/oraysl.status" 44 | orayslstatus=`head -n 3 $USER_DATA` 45 | SN=`head -n 2 $USER_DATA | tail -n 1 | cut -d= -f2-`; 46 | STATUS=`head -n 3 $USER_DATA | tail -n 1 | cut -d= -f2-`; 47 | szUID=`cat /etc/storage/PhMain.ini | grep "szUID=" | awk -F '=' '{print $2}'`; 48 | online=$(echo "$orayslstatus" | grep "ONLINE" | wc -l); 49 | } 50 | 51 | 52 | phddns_keep () { 53 | sleep 25 54 | i_app_keep -name="phddns" -pidof="oraysl" & 55 | i_app_keep -name="phddns" -pidof="oraynewph" & 56 | SVC_PATH="$(which oraysl)" 57 | [ ! -s "$SVC_PATH" ] && SVC_PATH="/opt/bin/oraysl" 58 | SVC_PATH2="$(which oraynewph)" 59 | [ ! -s "$SVC_PATH2" ] && SVC_PATH2="/opt/bin/oraynewph" 60 | 61 | USER_DATA="/tmp/oraysl.status" 62 | 63 | SN=`head -n 2 $USER_DATA | tail -n 1 | cut -d= -f2-`; 64 | STATUS=`head -n 3 $USER_DATA | tail -n 1 | cut -d= -f2-`; 65 | 66 | echo "RUNSTATUS= $STATUS" 67 | echo "SN= $SN" 68 | echo "LoginAddress= http://b.oray.com/" 69 | logger -t "【花生壳内网版】" "RUNSTATUS= $STATUS" 70 | logger -t "【花生壳内网版】" "SN= $SN " 71 | nvram set phddns_sn="$SN" 72 | nvram set phddns_st="$STATUS" 73 | szUID=0 74 | if [ -f /etc/storage/PhMain.ini ] ; then 75 | szUID=`cat /etc/storage/PhMain.ini | grep "szUID=" | awk -F '=' '{print $2}'`; 76 | fi 77 | if [ "$szUID" != "0" ] ; then 78 | logger -t "【花生壳内网版】" "已经绑定的花生壳账号:$szUID" 79 | nvram set phddns_szUID="$szUID" 80 | logger -t "【花生壳内网版】" "使用SN账号在【 http://b.oray.com 】登录." 81 | else 82 | logger -t "【花生壳内网版】" "没绑定的花生壳账号,请尽快绑定" 83 | logger -t "【花生壳内网版】" "使用 SN 账号在【 http://b.oray.com 】默认密码是 admin 登录." 84 | logger -t "【花生壳内网版】" "默认密码:admin, 默认密码:admin, 然后进行修改默认密码、手机验证、邮箱验证和花生壳账号绑定" 85 | logger -t "【花生壳内网版】" "!!>>绑定后需【写入】内部存储, 不然重启会丢失绑定.<>绑定后需【写入】内部存储, 不然重启会丢失绑定.<绑定后需【写入】内部存储, 不然重启会丢失绑定. /tmp/script/_ngrok 40 | chmod 777 /tmp/script/_ngrok 41 | fi 42 | 43 | ngrok_restart () { 44 | i_app_restart "$@" -name="ngrok" 45 | } 46 | 47 | ngrok_get_status () { 48 | 49 | B_restart="$ngrok_enable$ngrok_server$ngrok_port$ngrok_token$ngrok_domain$ngrok_domain_type$ngrok_domain_lhost$ngrok_domain_lport$ngrok_domain_sdname$ngrok_tcp$ngrok_tcp_type$ngrok_tcp_lhost$ngrok_tcp_lport$ngrok_tcp_rport$ngrok_custom$ngrok_custom_type$ngrok_custom_lhost$ngrok_custom_lport$ngrok_custom_hostname$(cat /etc/storage/ngrok_script.sh | grep -v '^#' | grep -v '^$')" 50 | 51 | i_app_get_status -name="ngrok" -valb="$B_restart" 52 | } 53 | 54 | ngrok_check () { 55 | 56 | ngrok_get_status 57 | if [ "$ngrok_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 58 | [ ! -z "`pidof ngrokc`" ] && logger -t "【ngrok】" "停止 ngrok" && ngrok_close 59 | { kill_ps "$scriptname" exit0; exit 0; } 60 | fi 61 | if [ "$ngrok_enable" = "1" ] ; then 62 | if [ "$needed_restart" = "1" ] ; then 63 | ngrok_close 64 | ngrok_start 65 | else 66 | [ -z "`pidof ngrokc`" ] && ngrok_restart 67 | fi 68 | fi 69 | } 70 | 71 | ngrok_keep () { 72 | i_app_keep -name="ngrok" -pidof="ngrokc" & 73 | } 74 | 75 | ngrok_close () { 76 | kill_ps "$scriptname keep" 77 | sed -Ei '/【ngrok】|^$/d' /tmp/script/_opt_script_check 78 | killall ngrokc ngrok_script.sh 79 | kill_ps "/tmp/script/_ngrok" 80 | kill_ps "_ngrok.sh" 81 | kill_ps "$scriptname" 82 | } 83 | 84 | ngrok_start () { 85 | check_webui_yes 86 | i_app_get_cmd_file -name="ngrok" -cmd="ngrokc" -cpath="/opt/bin/ngrokc" -down1="$hiboyfile/ngrokc" -down2="$hiboyfile2/ngrokc" -runh=" " 87 | logger -t "【ngrokc】" "运行 ngrok_script" 88 | sed -Ei '/UI设置自动生成/d' /etc/storage/ngrok_script.sh 89 | sed -Ei '/^$/d' /etc/storage/ngrok_script.sh 90 | # 系统分配域名 91 | if [ "$ngrok_domain" = "1" ] ; then 92 | cat >> "/etc/storage/ngrok_script.sh" <<-EUI 93 | ngrokc -SER[Shost:$ngrok_server,Sport:$ngrok_port,Atoken:$ngrok_token] -AddTun[Type:$ngrok_domain_type,Lhost:$ngrok_domain_lhost,Lport:$ngrok_domain_lport,Sdname:$ngrok_domain_sdname] 2>&1 & #UI设置自动生成 94 | EUI 95 | fi 96 | # TCP端口转发 97 | if [ "$ngrok_tcp" = "1" ] ; then 98 | cat >> "/etc/storage/ngrok_script.sh" <<-EUI 99 | ngrokc -SER[Shost:$ngrok_server,Sport:$ngrok_port,Atoken:$ngrok_token] -AddTun[Type:$ngrok_tcp_type,Lhost:$ngrok_tcp_lhost,Lport:$ngrok_tcp_lport,Rport:$ngrok_tcp_rport] 2>&1 & #UI设置自动生成 100 | EUI 101 | fi 102 | # 自定义域名 103 | if [ "$ngrok_custom" = "1" ] ; then 104 | cat >> "/etc/storage/ngrok_script.sh" <<-EUI 105 | ngrokc -SER[Shost:$ngrok_server,Sport:$ngrok_port,Atoken:$ngrok_token] -AddTun[Type:$ngrok_custom_type,Lhost:$ngrok_custom_lhost,Lport:$ngrok_custom_lport,Hostname:$ngrok_custom_hostname] 2>&1 & #UI设置自动生成 106 | EUI 107 | fi 108 | eval "/etc/storage/ngrok_script.sh $cmd_log" & 109 | restart_on_dhcpd 110 | sleep 4 111 | i_app_keep -t -name="ngrok" -pidof="ngrokc" 112 | ngrok_get_status 113 | eval "$scriptfilepath keep &" 114 | exit 0 115 | } 116 | 117 | initconfig () { 118 | 119 | ngrok_script="/etc/storage/ngrok_script.sh" 120 | if [ ! -f "$ngrok_script" ] || [ ! -s "$ngrok_script" ] ; then 121 | cat > "$ngrok_script" <<-\EEE 122 | #!/bin/bash 123 | export PATH='/etc/storage/bin:/tmp/script:/etc/storage/script:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin' 124 | export LD_LIBRARY_PATH=/lib:/opt/lib 125 | killall ngrokc 126 | #启动ngrok功能后会运行以下脚本 127 | #使用方法请查看论坛教程:http://www.right.com.cn/forum/thread-182340-1-1.html 128 | #ngrokc -SER[Shost:服务器域名,Sport:服务器端口,Atoken:服务器密码] -AddTun[Type:协议,Lhost:本地ip,Lport:本地端口,Rport:外网访问端口] 129 | #参数说明 130 | #Shost -服务器服务器地址 131 | #Sport -服务器端口 132 | #Atoken -服务器认证串 133 | #type -协议类型,tcp,http,https 134 | #Lhost -本地地址,如果是本机直接127.0.0.1 135 | #Lport -本地端口 136 | #Sdname -子域名 137 | #Hostname -自定义域名映射 备注:需要做域名解释到服务器地址 138 | #Rport -远程端口,tcp映射的时候,制定端口使用。 139 | #注册 http://www.ngrok.cc/ http://www.qydev.com/ 140 | #例子: 141 | #ngrokc -SER[Shost:tunnel.org.cn,Sport:4443] -AddTun[Type:https,Lhost:127.0.0.1,Lport:443,Sdname:test] & 142 | #ngrokc -SER[Shost:ss.ngrok.pw,Sport:4443] -AddTun[Type:tcp,Lhost:192.168.38.1,Lport:80,Rport:5678] & 143 | #ngrokc -SER[Shost:ngrokd.ngrok.com,Sport:443,Atoken:xxxxxxx] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:80,Rport:11199] & 144 | #ngrokc -SER[Shost:server.ngrok.cc,Sport:4443,Atoken:xxxxxxx] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:80,Sdname:abcd1234] & 145 | #ngrokc -SER[Shost:server.ngrok.cc,Sport:4443,Atoken:xxxxxxx] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:80,Hostname:www.abc.com] & 146 | 147 | 148 | 149 | EEE 150 | chmod 755 "$ngrok_script" 151 | fi 152 | 153 | } 154 | 155 | initconfig 156 | 157 | case $ACTION in 158 | start) 159 | ngrok_close 160 | ngrok_check 161 | ;; 162 | check) 163 | ngrok_check 164 | ;; 165 | stop) 166 | ngrok_close 167 | ;; 168 | keep) 169 | #ngrok_check 170 | ngrok_keep 171 | ;; 172 | *) 173 | ngrok_check 174 | ;; 175 | esac 176 | 177 | -------------------------------------------------------------------------------- /script/Sh34_wifi_dog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | wifidog_enable=`nvram get wifidog_enable` 5 | [ -z $wifidog_enable ] && wifidog_enable=0 && nvram set wifidog_enable=0 6 | if [ "$wifidog_enable" != "0" ] ; then 7 | 8 | wifidog_Daemon=`nvram get wifidog_Daemon` 9 | wifidog_Hostname=`nvram get wifidog_Hostname` 10 | wifidog_HTTPPort=`nvram get wifidog_HTTPPort` 11 | wifidog_Path=`nvram get wifidog_Path` 12 | wifidog_id=`nvram get wifidog_id` 13 | wifidog_lanif=`nvram get wifidog_lanif` 14 | wifidog_wanif=`nvram get wifidog_wanif` 15 | wifidog_Port=`nvram get wifidog_Port` 16 | wifidog_Interval=`nvram get wifidog_Interval` 17 | wifidog_Timeout=`nvram get wifidog_Timeout` 18 | wifidog_MaxConn=`nvram get wifidog_MaxConn` 19 | wifidog_MACList=`nvram get wifidog_MACList` 20 | 21 | wifidog_renum=`nvram get wifidog_renum` 22 | wifidog_renum=${wifidog_renum:-"0"} 23 | cmd_log_enable=`nvram get cmd_log_enable` 24 | cmd_name="wifidog" 25 | cmd_log="" 26 | if [ "$cmd_log_enable" = "1" ] || [ "$wifidog_renum" -gt "0" ] ; then 27 | cmd_log="$cmd_log2" 28 | fi 29 | fi 30 | 31 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep wifi_dog)" ] && [ ! -s /tmp/script/_wifi_dog ] ; then 32 | mkdir -p /tmp/script 33 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_wifi_dog 34 | chmod 777 /tmp/script/_wifi_dog 35 | fi 36 | 37 | IPT="/bin/iptables" 38 | #开关 39 | wifidog_Daemon=`nvram get wifidog_Daemon` 40 | 41 | 42 | #认证服务器 43 | [ -z $wifidog_HTTPPort ] && wifidog_HTTPPort="84" && nvram set wifidog_HTTPPort=$wifidog_HTTPPort 44 | [ -z $wifidog_Path ] && wifidog_Path="/" && nvram set wifidog_Path=$wifidog_Path 45 | 46 | #高级设置 47 | [ -z "$wifidog_id" ] && wifidog_id=$(/sbin/ifconfig br0 | sed -n '/HWaddr/ s/^.*HWaddr */HWADDR=/pg' | awk -F"=" '{print $2}' |sed -n 's/://pg'| awk -F" " '{print $1}') && nvram set wifidog_id=$wifidog_id 48 | [ -z $wifidog_lanif ] && wifidog_lanif="br0" && nvram set wifidog_lanif=$wifidog_lanif 49 | [ -z $wifidog_wanif ] && wifidog_wanif=$(nvram get wan0_ifname_t) && nvram set wifidog_wanif=$wifidog_wanif 50 | [ -z $wifidog_Port ] && wifidog_Port="2060" && nvram set wifidog_Port=$wifidog_Port 51 | [ -z $wifidog_Interval ] && wifidog_Interval="60" && nvram set wifidog_Interval=$wifidog_Interval 52 | [ -z $wifidog_Timeout ] && wifidog_Timeout="5" && nvram set wifidog_Timeout=$wifidog_Timeout 53 | [ -z $wifidog_MaxConn ] && wifidog_MaxConn="30" && nvram set wifidog_MaxConn=$wifidog_MaxConn 54 | [ -z $wifidog_MACList ] && wifidog_MACList="00:00:DE:AD:BE:AF" && nvram set wifidog_MACList=$wifidog_MACList 55 | 56 | wifidog_restart () { 57 | i_app_restart "$@" -name="wifidog" 58 | } 59 | 60 | wifidog_get_status () { 61 | 62 | B_restart="$wifidog_enable$wifidog_Daemon$wifidog_Hostname$wifidog_HTTPPort$wifidog_Path$wifidog_id$wifidog_lanif$wifidog_wanif$wifidog_Port$wifidog_Interval$wifidog_Timeout$wifidog_MaxConn$wifidog_MACList" 63 | 64 | i_app_get_status -name="wifidog" -valb="$B_restart" 65 | } 66 | 67 | wifidog_check () { 68 | 69 | wifidog_get_status 70 | if [ "$wifidog_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 71 | [ ! -z "`pidof wifidog`" ] && logger -t "【wifidog】" "停止 wifidog" && wifidog_close 72 | { kill_ps "$scriptname" exit0; exit 0; } 73 | fi 74 | if [ "$wifidog_enable" = "1" ] ; then 75 | if [ "$needed_restart" = "1" ] ; then 76 | wifidog_close 77 | wifidog_start 78 | else 79 | [ -z "`pidof wifidog`" ] && wifidog_restart 80 | fi 81 | fi 82 | } 83 | 84 | wifidog_keep () { 85 | i_app_keep -name="wifidog" -pidof="wifidog" & 86 | } 87 | 88 | wifidog_close () { 89 | kill_ps "$scriptname keep" 90 | sed -Ei '/【wifidog】|^$/d' /tmp/script/_opt_script_check 91 | echo "Stopping Wifidog ... " 92 | if $WD_DIR/wdctl status 2> /dev/null 93 | then 94 | if $WD_DIR/wdctl stop 95 | then 96 | echo "OK" 97 | else 98 | echo "FAILED: wdctl stop exited with non 0 status" 99 | fi 100 | else 101 | echo "FAILED: Wifidog was not running" 102 | fi 103 | $WD_DIR/wdctl stop 104 | killall wifidog wdctl 105 | kill_ps "/tmp/script/_wifi_dog" 106 | kill_ps "_wifi_dog.sh" 107 | kill_ps "$scriptname" 108 | } 109 | 110 | wifidog_start () { 111 | check_webui_yes 112 | i_app_get_cmd_file -name="wifidog" -cmd="wdctl" -cpath="/opt/bin/wdctl" -down1="$hiboyfile/wdctl" -down2="$hiboyfile2/wdctl" -runh="x" 113 | i_app_get_cmd_file -name="wifidog" -cmd="wifidog" -cpath="/opt/bin/wifidog" -down1="$hiboyfile/wifidog" -down2="$hiboyfile2/wifidog" 114 | 115 | logger -t "【wifidog】" "运行 wifidog" 116 | 117 | rm -f /etc/storage/wifidog.conf 118 | # 将数值赋给WiFiDog官方的配置参数 119 | cat > "/etc/storage/wifidog.conf" <<-FWD 120 | #WiFiDog 配置文件 121 | 122 | #网关ID 123 | GatewayID $wifidog_id 124 | 125 | #内部网卡 126 | GatewayInterface $wifidog_lanif 127 | 128 | #外部网卡 129 | ExternalInterface $wifidog_wanif 130 | 131 | #认证服务器 132 | AuthServer { 133 | Hostname $wifidog_Hostname 134 | HTTPPort $wifidog_HTTPPort 135 | Path $wifidog_Path 136 | } 137 | 138 | #守护进程 139 | Daemon $wifidog_Daemon 140 | 141 | #检查DNS状态(Check DNS health by querying IPs of these hosts) 142 | PopularServers $wifidog_Hostname 143 | 144 | #运行状态 145 | HtmlMessageFile /www/wifidog-msg.html 146 | 147 | #监听端口 148 | GatewayPort $wifidog_Port 149 | 150 | #心跳间隔时间 151 | CheckInterval $wifidog_Interval 152 | 153 | #心跳间隔次数 154 | ClientTimeout $wifidog_Timeout 155 | 156 | #HTTP最大连接数 157 | HTTPDMaxConn $wifidog_MaxConn 158 | 159 | #信任的MAC地址,加入信任列表将不用登录可访问 160 | TrustedMACList $wifidog_MACList 161 | 162 | #全局防火墙设置 163 | FirewallRuleSet global { 164 | FirewallRule allow tcp port 443 165 | } 166 | 167 | #新验证用户 168 | FirewallRuleSet validating-users { 169 | FirewallRule allow to 0.0.0.0/0 170 | } 171 | #正常用户 172 | FirewallRuleSet known-users { 173 | FirewallRule allow to 0.0.0.0/0 174 | } 175 | 176 | #未知用户 177 | FirewallRuleSet unknown-users { 178 | FirewallRule allow udp port 53 179 | FirewallRule allow tcp port 53 180 | FirewallRule allow udp port 67 181 | FirewallRule allow tcp port 67 182 | } 183 | 184 | #锁住用户 185 | FirewallRuleSet locked-users { 186 | FirewallRule block to 0.0.0.0/0 187 | FWD 188 | 189 | chmod 777 "$SVC_PATH" 190 | eval "$SVC_PATH -c /etc/storage/wifidog.conf $cmd_log" & 191 | 192 | sleep 4 193 | i_app_keep -t -name="wifidog" -pidof="wifidog" 194 | #wifidog_get_status 195 | eval "$scriptfilepath keep &" 196 | exit 0 197 | } 198 | 199 | 200 | 201 | stop() 202 | { 203 | logger -t "【Wifidog】" "关闭" 204 | echo "Stopping Wifidog ... " 205 | if $WD_DIR/wdctl status 2> /dev/null 206 | then 207 | if $WD_DIR/wdctl stop 208 | then 209 | echo "OK" 210 | else 211 | echo "FAILED: wdctl stop exited with non 0 status" 212 | fi 213 | else 214 | echo "FAILED: Wifidog was not running" 215 | fi 216 | } 217 | 218 | case $ACTION in 219 | start) 220 | wifidog_close 221 | wifidog_check 222 | ;; 223 | check) 224 | wifidog_check 225 | ;; 226 | stop) 227 | wifidog_close 228 | ;; 229 | keep) 230 | #wifidog_check 231 | wifidog_keep 232 | ;; 233 | *) 234 | wifidog_check 235 | ;; 236 | esac 237 | 238 | -------------------------------------------------------------------------------- /script/Sh43_cloudxns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "Sh43_cloudxns" -------------------------------------------------------------------------------- /script/Sh45_server_chan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 失效清理 3 | echo "Sh45_server_chan" -------------------------------------------------------------------------------- /script/Sh47_ssrserver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "Sh47_ssrserver" 5 | -------------------------------------------------------------------------------- /script/Sh51_xun_lei.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "Sh51_xun_lei" 5 | -------------------------------------------------------------------------------- /script/Sh53_you_ku.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "Sh53_you_ku" -------------------------------------------------------------------------------- /script/Sh56_gofly_way.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | goflyway_enable=`nvram get app_23` 5 | [ -z $goflyway_enable ] && goflyway_enable=0 && nvram set app_23=0 6 | mkdir -p /etc/storage/goflyway 7 | keypem_s_path="/etc/storage/goflyway/key.pem" 8 | capem_s_path="/etc/storage/goflyway/ca.pem" 9 | keypem_path="/opt/bin/key.pem" 10 | capem_path="/opt/bin/ca.pem" 11 | 12 | goflyway_renum=`nvram get goflyway_renum` 13 | goflyway_renum=${goflyway_renum:-"0"} 14 | cmd_log_enable=`nvram get cmd_log_enable` 15 | cmd_name="goflyway" 16 | cmd_log="" 17 | if [ "$cmd_log_enable" = "1" ] || [ "$goflyway_renum" -gt "0" ] ; then 18 | cmd_log="$cmd_log2" 19 | fi 20 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep gofly_way)" ] && [ ! -s /tmp/script/_app7 ] ; then 21 | mkdir -p /tmp/script 22 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app7 23 | chmod 777 /tmp/script/_app7 24 | fi 25 | 26 | goflyway_restart () { 27 | i_app_restart "$@" -name="goflyway" 28 | } 29 | 30 | goflyway_get_status () { 31 | 32 | B_restart="$goflyway_enable$(cat /etc/storage/app_7.sh | grep -v '^#' | grep -v '^$')" 33 | 34 | i_app_get_status -name="goflyway" -valb="$B_restart" 35 | } 36 | 37 | goflyway_check () { 38 | 39 | goflyway_get_status 40 | if [ "$goflyway_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 41 | [ ! -z "`pidof goflyway`" ] && logger -t "【goflyway】" "停止 goflyway" && goflyway_close 42 | { kill_ps "$scriptname" exit0; exit 0; } 43 | fi 44 | if [ "$goflyway_enable" = "1" ] ; then 45 | if [ "$needed_restart" = "1" ] ; then 46 | goflyway_close 47 | goflyway_start 48 | else 49 | [ -z "`pidof goflyway`" ] && goflyway_restart 50 | fi 51 | fi 52 | } 53 | 54 | goflyway_keep () { 55 | i_app_keep -name="goflyway" -pidof="goflyway" & 56 | } 57 | 58 | goflyway_close () { 59 | 60 | kill_ps "$scriptname keep" 61 | sed -Ei '/【goflyway】|^$/d' /tmp/script/_opt_script_check 62 | killall goflyway 63 | kill_ps "/tmp/script/_app7" 64 | kill_ps "_gofly_way.sh" 65 | kill_ps "$scriptname" 66 | } 67 | 68 | goflyway_start () { 69 | 70 | check_webui_yes 71 | i_app_get_cmd_file -name="goflyway" -cmd="goflyway" -cpath="/opt/bin/goflyway" -down1="$hiboyfile/goflyway" -down2="$hiboyfile2/goflyway" 72 | if [ -s "$SVC_PATH" ] ; then 73 | if [ ! -s "$capem_s_path" ] && [ -s "$capem_path" ] ; then 74 | cp -f "$keypem_path" "$keypem_s_path" 75 | cp -f "$capem_path" "$capem_s_path" 76 | fi 77 | rm -f "$keypem_path" "$capem_path" 78 | ln -sf "$keypem_s_path" "$keypem_path" 79 | ln -sf "$capem_s_path" "$capem_path" 80 | if [ ! -s "$capem_path" ] && [[ "$(goflyway -h 2>&1 | grep gen-ca | wc -l)" -gt 0 ]] ; then 81 | logger -t "【goflyway】" "找不到 $capem_path 正在生成 ca.pem、key.pem 稍等几分钟" 82 | cd /opt/bin/ 83 | ./goflyway -gen-ca 84 | fi 85 | if [ ! -s "$capem_path" ] ; then 86 | wgetcurl_checkmd5 "$capem_path" "$hiboyfile/ca.pem" "$hiboyfile2/ca.pem" N 87 | fi 88 | if [ -s "$capem_path" ] ; then 89 | chmod 755 "$capem_path" "$keypem_path" 90 | fi 91 | [ ! -f /opt/bin/chinalist.txt ] && update_chnlist 92 | 93 | fi 94 | [[ "$(goflyway -h 2>&1 | wc -l)" -lt 2 ]] && rm -rf /opt/bin/goflyway 95 | if [ ! -s "$SVC_PATH" ] ; then 96 | logger -t "【goflyway】" "找不到 $SVC_PATH ,需要手动安装 $SVC_PATH" 97 | logger -t "【goflyway】" "启动失败, 10 秒后自动尝试重新启动" && sleep 10 && goflyway_restart x 98 | fi 99 | chmod 777 "$SVC_PATH" 100 | goflyway_v=$(goflyway -version | grep goflyway | sed -n '1p') 101 | nvram set goflyway_v="$goflyway_v" 102 | logger -t "【goflyway】" "运行 goflyway" 103 | 104 | #运行脚本启动/opt/bin/goflyway 105 | chmod 777 /etc/storage/app_7.sh 106 | cd $(dirname `which goflyway`) 107 | eval "/etc/storage/app_7.sh $cmd_log" & 108 | 109 | sleep 4 110 | i_app_keep -t -name="goflyway" -pidof="goflyway" 111 | 112 | #goflyway_get_status 113 | eval "$scriptfilepath keep &" 114 | exit 0 115 | } 116 | 117 | update_chnlist () { 118 | nvram set app_111=4 && Sh99_ss_tproxy.sh 119 | cat /opt/app/ss_tproxy/rule/chnlist.txt | grep -v '^#' | sed -e 's@^cn$@com.cn@g' | sort -u | grep -v '^$' > /opt/bin/chinalist.txt 120 | 121 | } 122 | 123 | initconfig () { 124 | if [ ! -f "/etc/storage/app_7.sh" ] || [ ! -s "/etc/storage/app_7.sh" ] ; then 125 | cat > "/etc/storage/app_7.sh" <<-\VVR 126 | #!/bin/bash 127 | # 启动运行的脚本 128 | export PATH='/etc/storage/bin:/tmp/script:/etc/storage/script:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin' 129 | export LD_LIBRARY_PATH=/lib:/opt/lib 130 | # https://github.com/coyove/goflyway/wiki/使用教程 131 | cd $(dirname ` which goflyway`) 132 | #在服务器执行下面命令即可启动服务端,KEY123为自定义密码,默认监听8100。本地执行 133 | #./goflyway -t 0 -k=KEY123 -l="0.0.0.0:8100" 2>&1 & 134 | 135 | #客户端命令(1.2.3.4要修改为服务器IP,默认监听8100) 136 | goflyway -t 0 -k=KEY123 -up="1.2.3.4:8100" -l="0.0.0.0:8100" 2>&1 & 137 | 138 | #可以配合 Proxifier、chrome(switchysharp、SwitchyOmega) 代理插件使用 139 | #请设置以上软件的本地代理为 192.168.123.1:8100(协议为HTTP或SOCKS5代理,192.168.123.1为路由器IP) 140 | 141 | VVR 142 | fi 143 | 144 | } 145 | 146 | initconfig 147 | 148 | update_app () { 149 | mkdir -p /opt/app/goflyway 150 | if [ "$1" = "update_asp" ] ; then 151 | rm -rf /opt/app/goflyway/Advanced_Extensions_goflyway.asp 152 | fi 153 | if [ "$1" = "del" ] ; then 154 | rm -rf /opt/app/goflyway/Advanced_Extensions_goflyway.asp 155 | [ -f /opt/bin/goflyway ] && rm -f /opt/bin/goflyway /opt/bin/chinalist.txt /etc/storage/app_7.sh 156 | [ -f "$capem_s_path" ] && rm -f "$keypem_s_path" "$capem_s_path" "$keypem_path" "$capem_path" 157 | rm -f /opt/opt_backup/bin/goflyway /opt/opt_backup/bin/key.pem /opt/opt_backup/bin/ca.pem 158 | 159 | fi 160 | 161 | initconfig 162 | 163 | # 加载程序配置页面 164 | if [ ! -f "/opt/app/goflyway/Advanced_Extensions_goflyway.asp" ] || [ ! -s "/opt/app/goflyway/Advanced_Extensions_goflyway.asp" ] ; then 165 | wgetcurl.sh /opt/app/goflyway/Advanced_Extensions_goflyway.asp "$hiboyfile/Advanced_Extensions_goflywayasp" "$hiboyfile2/Advanced_Extensions_goflywayasp" 166 | fi 167 | umount /www/Advanced_Extensions_app07.asp 168 | mount --bind /opt/app/goflyway/Advanced_Extensions_goflyway.asp /www/Advanced_Extensions_app07.asp 169 | # 更新程序启动脚本 170 | 171 | [ "$1" = "del" ] && /etc/storage/www_sh/goflyway del & 172 | } 173 | 174 | case $ACTION in 175 | start) 176 | goflyway_close 177 | goflyway_check 178 | ;; 179 | check) 180 | goflyway_check 181 | ;; 182 | stop) 183 | goflyway_close 184 | ;; 185 | updateapp7) 186 | goflyway_restart o 187 | [ "$goflyway_enable" = "1" ] && nvram set goflyway_status="updategoflyway" && logger -t "【goflyway】" "重启" && goflyway_restart 188 | [ "$goflyway_enable" != "1" ] && nvram set goflyway_v="" && logger -t "【goflyway】" "更新" && update_app del 189 | ;; 190 | update_app) 191 | update_app 192 | ;; 193 | update_asp) 194 | update_app update_asp 195 | ;; 196 | keep) 197 | #goflyway_check 198 | goflyway_keep 199 | ;; 200 | initconfig) 201 | initconfig 202 | ;; 203 | *) 204 | goflyway_check 205 | ;; 206 | esac 207 | 208 | -------------------------------------------------------------------------------- /script/Sh57_virtual_here.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | virtualhere_enable=`nvram get app_24` 5 | [ -z $virtualhere_enable ] && virtualhere_enable=0 && nvram set app_24=0 6 | virtualhere_wan=`nvram get app_25` 7 | [ -z $virtualhere_wan ] && virtualhere_wan=0 && nvram set app_25=0 8 | 9 | virtualhere_renum=`nvram get virtualhere_renum` 10 | virtualhere_renum=${virtualhere_renum:-"0"} 11 | cmd_log_enable=`nvram get cmd_log_enable` 12 | cmd_name="virtualhere" 13 | cmd_log="" 14 | if [ "$cmd_log_enable" = "1" ] || [ "$virtualhere_renum" -gt "0" ] ; then 15 | cmd_log="$cmd_log2" 16 | fi 17 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep virtual_here)" ] && [ ! -s /tmp/script/_app8 ] ; then 18 | mkdir -p /tmp/script 19 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app8 20 | chmod 777 /tmp/script/_app8 21 | fi 22 | 23 | virtualhere_restart () { 24 | i_app_restart "$@" -name="virtualhere" 25 | } 26 | 27 | virtualhere_get_status () { 28 | 29 | B_restart="$virtualhere_enable$virtualhere_wan$(cat /etc/storage/app_8.sh | grep -v '^#' | grep -v '^$')" 30 | i_app_get_status -name="virtualhere" -valb="$B_restart" 31 | } 32 | 33 | virtualhere_check () { 34 | 35 | virtualhere_get_status 36 | if [ "$virtualhere_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 37 | [ ! -z "`pidof virtualhere`" ] && logger -t "【virtualhere】" "停止 virtualhere" && virtualhere_close 38 | { kill_ps "$scriptname" exit0; exit 0; } 39 | fi 40 | if [ "$virtualhere_enable" = "1" ] ; then 41 | if [ "$needed_restart" = "1" ] ; then 42 | virtualhere_close 43 | virtualhere_start 44 | else 45 | [ -z "`pidof virtualhere`" ] && virtualhere_restart 46 | virtualhere_port_dpt 47 | fi 48 | fi 49 | } 50 | 51 | virtualhere_keep () { 52 | i_app_keep -name="virtualhere" -pidof="virtualhere" & 53 | } 54 | 55 | virtualhere_close () { 56 | 57 | kill_ps "$scriptname keep" 58 | sed -Ei '/【virtualhere】|^$/d' /tmp/script/_opt_script_check 59 | iptables -t filter -D INPUT -p tcp --dport 7575 -j ACCEPT 60 | killall virtualhere 61 | kill_ps "/tmp/script/_app8" 62 | kill_ps "_virtual_here.sh" 63 | kill_ps "$scriptname" 64 | } 65 | 66 | virtualhere_start () { 67 | 68 | check_webui_yes 69 | i_app_get_cmd_file -name="virtualhere" -cmd="virtualhere" -cpath="/opt/bin/virtualhere" -down1="$hiboyfile/virtualhere" -down2="$hiboyfile2/virtualhere" 70 | virtualhere_v=$(virtualhere -h | grep virtualhere | sed -n '1p') 71 | [ "$(nvram get virtualhere_v)" != "$virtualhere_v" ] && nvram set virtualhere_v="$virtualhere_v" 72 | logger -t "【virtualhere】" "运行 virtualhere" 73 | 74 | #运行脚本启动/opt/bin/virtualhere 75 | cd $(dirname `which virtualhere`) 76 | ln -sf /etc/storage/app_8.sh ~/config.ini 77 | eval "virtualhere -b $cmd_log" & 78 | 79 | sleep 4 80 | i_app_keep -t -name="virtualhere" -pidof="virtualhere" 81 | virtualhere_port_dpt 82 | #virtualhere_get_status 83 | eval "$scriptfilepath keep &" 84 | exit 0 85 | } 86 | 87 | initconfig () { 88 | if [ ! -f "/etc/storage/app_8.sh" ] || [ ! -s "/etc/storage/app_8.sh" ] ; then 89 | cat > "/etc/storage/app_8.sh" <<-\VVR 90 | ServerName=$HOSTNAME$ 91 | 92 | VVR 93 | fi 94 | 95 | ln -sf /etc/storage/app_8.sh ~/config.ini 96 | 97 | } 98 | 99 | initconfig 100 | 101 | virtualhere_port_dpt () { 102 | 103 | if [ "$virtualhere_wan" = "1" ] ; then 104 | port=$(iptables -t filter -L INPUT -v -n --line-numbers | grep dpt:7575 | cut -d " " -f 1 | sort -nr | wc -l) 105 | if [ "$port" = 0 ] ; then 106 | logger -t "【virtualhere】" "允许 7575 tcp端口通过防火墙" 107 | iptables -t filter -I INPUT -p tcp --dport 7575 -j ACCEPT 108 | iptables -t filter -I INPUT -p udp --dport 7575 -j ACCEPT 109 | fi 110 | fi 111 | } 112 | 113 | update_app () { 114 | mkdir -p /opt/app/virtualhere 115 | if [ "$1" = "update_asp" ] ; then 116 | rm -rf /opt/app/virtualhere/Advanced_Extensions_virtualhere.asp 117 | fi 118 | if [ "$1" = "del" ] ; then 119 | rm -rf /opt/app/virtualhere/Advanced_Extensions_virtualhere.asp 120 | [ -f /opt/bin/virtualhere ] && rm -f /opt/bin/virtualhere /opt/opt_backup/bin/virtualhere 121 | fi 122 | 123 | initconfig 124 | 125 | # 加载程序配置页面 126 | if [ ! -f "/opt/app/virtualhere/Advanced_Extensions_virtualhere.asp" ] || [ ! -s "/opt/app/virtualhere/Advanced_Extensions_virtualhere.asp" ] ; then 127 | wgetcurl.sh /opt/app/virtualhere/Advanced_Extensions_virtualhere.asp "$hiboyfile/Advanced_Extensions_virtualhereasp" "$hiboyfile2/Advanced_Extensions_virtualhereasp" 128 | fi 129 | umount /www/Advanced_Extensions_app08.asp 130 | mount --bind /opt/app/virtualhere/Advanced_Extensions_virtualhere.asp /www/Advanced_Extensions_app08.asp 131 | # 更新程序启动脚本 132 | 133 | [ "$1" = "del" ] && /etc/storage/www_sh/virtualhere del & 134 | } 135 | 136 | case $ACTION in 137 | start) 138 | virtualhere_close 139 | virtualhere_check 140 | ;; 141 | check) 142 | virtualhere_check 143 | ;; 144 | stop) 145 | virtualhere_close 146 | ;; 147 | updateapp8) 148 | virtualhere_restart o 149 | [ "$virtualhere_enable" = "1" ] && nvram set virtualhere_status="updatevirtualhere" && logger -t "【virtualhere】" "重启" && virtualhere_restart 150 | [ "$virtualhere_enable" != "1" ] && nvram set virtualhere_v="" && logger -t "【virtualhere】" "更新" && update_app del 151 | ;; 152 | update_app) 153 | update_app 154 | ;; 155 | update_asp) 156 | update_app update_asp 157 | ;; 158 | keep) 159 | #virtualhere_check 160 | virtualhere_keep 161 | ;; 162 | initconfig) 163 | initconfig 164 | ;; 165 | *) 166 | virtualhere_check 167 | ;; 168 | esac 169 | 170 | -------------------------------------------------------------------------------- /script/Sh59_trans_late.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "Sh59_trans_late" -------------------------------------------------------------------------------- /script/Sh62_shellina_box.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | shellinabox_port=`nvram get shellinabox_port` 5 | shellinabox_enable=`nvram get shellinabox_enable` 6 | [ -z $shellinabox_enable ] && shellinabox_enable=0 && nvram set shellinabox_enable=$shellinabox_enable 7 | if [ "$shellinabox_enable" != "0" ] ; then 8 | 9 | shellinabox_css="$(nvram get shellinabox_css)" 10 | shellinabox_wan=`nvram get shellinabox_wan` 11 | shellinabox_options_ttyd="$(nvram get shellinabox_options_ttyd)" 12 | 13 | [ -z $shellinabox_port ] && shellinabox_port="4200" && nvram set shellinabox_port=$shellinabox_port 14 | [ -z "$shellinabox_css" ] && shellinabox_css="white-on-black" && nvram set shellinabox_css="$shellinabox_css" 15 | 16 | [ -z "$shellinabox_options_ttyd" ] && shellinabox_options_ttyd="login" && nvram set shellinabox_options_ttyd="$shellinabox_options_ttyd" 17 | 18 | shellinabox_renum=`nvram get shellinabox_renum` 19 | shellinabox_renum=${shellinabox_renum:-"0"} 20 | cmd_log_enable=`nvram get cmd_log_enable` 21 | cmd_name="shellinabox" 22 | cmd_log="" 23 | if [ "$cmd_log_enable" = "1" ] || [ "$shellinabox_renum" -gt "0" ] ; then 24 | cmd_log="$cmd_log2" 25 | fi 26 | fi 27 | shell_log="【shellinabox】" 28 | [ "$shellinabox_enable" = "2" ] && shell_log="【ttyd】" 29 | 30 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep shellina_box)" ] && [ ! -s /tmp/script/_shellina_box ] ; then 31 | mkdir -p /tmp/script 32 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_shellina_box 33 | chmod 777 /tmp/script/_shellina_box 34 | fi 35 | 36 | shellinabox_restart () { 37 | i_app_restart "$@" -name="shellinabox" 38 | } 39 | 40 | shellinabox_get_status () { 41 | 42 | B_restart="$shellinabox_enable$shellinabox_port$shellinabox_css$shellinabox_options$shellinabox_wan$shellinabox_options_ttyd" 43 | 44 | i_app_get_status -name="shellinabox" -valb="$B_restart" 45 | } 46 | 47 | shellinabox_check () { 48 | 49 | shellinabox_get_status 50 | if [ "$shellinabox_enable" = "0" ] && [ "$needed_restart" = "1" ] ; then 51 | [ ! -z "`pidof shellinaboxd`" ] && logger -t "$shell_log" "停止 shellinaboxd" && shellinabox_close 52 | [ ! -z "`pidof ttyd`" ] && logger -t "【ttyd】" "停止 ttyd" && shellinabox_close 53 | { kill_ps "$scriptname" exit0; exit 0; } 54 | fi 55 | if [ "$shellinabox_enable" = "1" ] || [ "$shellinabox_enable" = "2" ] ; then 56 | if [ "$needed_restart" = "1" ] ; then 57 | shellinabox_close 58 | shellinabox_start 59 | else 60 | [ "$shellinabox_enable" = "1" ] && [ -z "`pidof shellinaboxd`" ] && shellinabox_restart 61 | [ "$shellinabox_enable" = "2" ] && [ -z "`pidof ttyd`" ] && shellinabox_restart 62 | shellinabox_port_dpt 63 | fi 64 | fi 65 | } 66 | 67 | shellinabox_keep () { 68 | logger -t "$shell_log" "守护进程启动" 69 | if [ "$shellinabox_enable" = "1" ] ; then 70 | i_app_keep -name="shellinabox" -pidof="shellinaboxd" & 71 | fi 72 | if [ "$shellinabox_enable" = "2" ] ; then 73 | i_app_keep -name="shellinabox" -pidof="ttyd" & 74 | fi 75 | } 76 | 77 | shellinabox_close () { 78 | 79 | kill_ps "$scriptname keep" 80 | sed -Ei '/【shellinabox】|^$/d' /tmp/script/_opt_script_check 81 | sed -Ei '/【ttyd】|^$/d' /tmp/script/_opt_script_check 82 | iptables -t filter -D INPUT -p tcp --dport $shellinabox_port -j ACCEPT 83 | killall shellinaboxd ttyd 84 | kill_ps "/tmp/script/_shellina_box" 85 | kill_ps "_shellina_box.sh" 86 | kill_ps "$scriptname" 87 | } 88 | 89 | shellinabox_start () { 90 | check_webui_yes 91 | if [ "$shellinabox_enable" = "2" ] ; then 92 | cmd_name="ttyd" 93 | i_app_get_cmd_file -name="shellinabox" -cmd="ttyd" -cpath="/opt/bin/ttyd" -down1="$hiboyfile/ttyd" -down2="$hiboyfile2/ttyd" 94 | hash ttyd 2>/dev/null || { logger -t "$shell_log" "找不到 ttyd,尝试启动shellinaboxd"; nvram set shellinabox_enable=1; shellinabox_restart ; } 95 | eval "ttyd --port $shellinabox_port $shellinabox_options_ttyd $cmd_log" & 96 | sleep 5 97 | i_app_keep -t -name="shellinabox" -pidof="ttyd" 98 | 99 | fi 100 | if [ "$shellinabox_enable" = "1" ] ; then 101 | cmd_name="shellinabox" 102 | SVC_PATH="/opt/sbin/shellinaboxd" 103 | chmod 777 "$SVC_PATH" 104 | if [ ! -s "$SVC_PATH" ] ; then 105 | logger -t "$shell_log" "找不到 $SVC_PATH,安装 opt mini 程序" 106 | /etc/storage/script/Sh01_mountopt.sh opt_mini_wget 107 | fi 108 | [[ "$(shellinaboxd -h 2>&1 | wc -l)" -lt 2 ]] && /etc/storage/script/Sh01_mountopt.sh libmd5_check 109 | if [ ! -s "$SVC_PATH" ] ; then 110 | logger -t "$shell_log" "找不到 $SVC_PATH ,需要手动安装 $SVC_PATH" 111 | logger -t "$shell_log" "启动失败, 10 秒后自动尝试重新启动" && sleep 10 && shellinabox_restart x 112 | fi 113 | logger -t "【shellinaboxd】" "运行 shellinaboxd" 114 | /opt/etc/init.d/S88shellinaboxd stop 115 | sleep 5 116 | eval "/opt/etc/init.d/S88shellinaboxd start $cmd_log" & 117 | sleep 5 118 | i_app_keep -t -name="shellinabox" -pidof="shellinaboxd" 119 | 120 | fi 121 | shellinabox_port_dpt 122 | #shellinabox_get_status 123 | eval "$scriptfilepath keep &" 124 | exit 0 125 | } 126 | 127 | update_app () { 128 | SVC_PATH="/opt/bin/ttyd" 129 | rm -rf "$SVC_PATH" /opt/opt_backup/bin/ttyd 130 | /etc/storage/script/Sh01_mountopt.sh start 131 | wgetcurl_file "$SVC_PATH" "$hiboyfile/ttyd" "$hiboyfile2/ttyd" 132 | chmod 777 "$SVC_PATH" 133 | } 134 | 135 | shellinabox_port_dpt () { 136 | 137 | if [ "$shellinabox_wan" = "1" ] ; then 138 | port=$(iptables -t filter -L INPUT -v -n --line-numbers | grep dpt:$shellinabox_port | cut -d " " -f 1 | sort -nr | wc -l) 139 | if [ "$port" = 0 ] ; then 140 | logger -t "$shell_log" "检测:找不到 ss-server 端口:$shellinabox_port 规则, 重新添加" 141 | iptables -t filter -I INPUT -p tcp --dport $shellinabox_port -j ACCEPT 142 | fi 143 | fi 144 | 145 | } 146 | 147 | case $ACTION in 148 | start) 149 | shellinabox_close 150 | shellinabox_check 151 | ;; 152 | check) 153 | shellinabox_check 154 | ;; 155 | stop) 156 | shellinabox_close 157 | ;; 158 | update_app) 159 | update_app 160 | ;; 161 | keep) 162 | #shellinabox_check 163 | shellinabox_keep 164 | ;; 165 | *) 166 | shellinabox_check 167 | ;; 168 | esac 169 | 170 | -------------------------------------------------------------------------------- /script/Sh87_cad_dy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | caddy_enable=`nvram get app_139` 5 | [ -z $caddy_enable ] && caddy_enable=0 && nvram set app_139=0 6 | 7 | if [ "$caddy_enable" != "0" ] ; then 8 | 9 | caddy_renum=`nvram get caddy_renum` 10 | caddy_renum=${caddy_renum:-"0"} 11 | 12 | cmd_log_enable=`nvram get cmd_log_enable` 13 | cmd_name="caddy" 14 | cmd_log="" 15 | if [ "$cmd_log_enable" = "1" ] || [ "$caddy_renum" -gt "0" ] ; then 16 | cmd_log="$cmd_log2" 17 | fi 18 | 19 | fi 20 | 21 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep cad_dy)" ] && [ ! -s /tmp/script/_app26 ] ; then 22 | mkdir -p /tmp/script 23 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app26 24 | chmod 777 /tmp/script/_app26 25 | fi 26 | 27 | caddy_restart () { 28 | i_app_restart "$@" -name="caddy" 29 | } 30 | 31 | caddy_get_status () { 32 | 33 | B_restart="$caddy_enable$(cat /etc/storage/app_11.sh | grep -v '^#' | grep -v '^$')" 34 | 35 | i_app_get_status -name="caddy" -valb="$B_restart" 36 | } 37 | 38 | caddy_check () { 39 | 40 | caddy_get_status 41 | if [ "$caddy_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 42 | [ ! -z "`pidof caddy`" ] && logger -t "【caddy】" "停止 caddy" && caddy_close 43 | { kill_ps "$scriptname" exit0; exit 0; } 44 | fi 45 | if [ "$caddy_enable" = "1" ] ; then 46 | if [ "$needed_restart" = "1" ] ; then 47 | caddy_close 48 | caddy_start 49 | else 50 | [ "$caddy_enable" = "1" ] && [ -z "`pidof caddy`" ] && caddy_restart 51 | fi 52 | fi 53 | } 54 | 55 | caddy_keep () { 56 | i_app_keep -name="caddy" -pidof="caddy" -cpath="/opt/caddy/caddy" & 57 | } 58 | 59 | caddy_close () { 60 | sed -Ei '/【caddy】|^$/d' /tmp/script/_opt_script_check 61 | killall caddy 62 | kill_ps "/tmp/script/_app26" 63 | kill_ps "_cad_dy.sh" 64 | kill_ps "$scriptname" 65 | } 66 | 67 | caddy_start () { 68 | check_webui_yes 69 | i_app_get_cmd_file -name="caddy" -cmd="/opt/caddy/caddy" -cpath="/opt/caddy/caddy" -down1="$hiboyfile/caddy2" -down2="$hiboyfile2/caddy2" -runh="help" 70 | caddy_v=`/opt/caddy/caddy version | awk -F ' ' '{print $1;}'` 71 | [ "$(nvram get caddy_v)" != "$caddy_v" ] && nvram set caddy_v="$caddy_v" 72 | rm -f /opt/caddy/Caddyfile 73 | cat /etc/storage/app_11.sh >> /opt/caddy/Caddyfile 74 | echo "" >> /opt/caddy/Caddyfile 75 | logger -t "【caddy】" "运行 $SVC_PATH" 76 | eval "/opt/caddy/caddy run --config /opt/caddy/Caddyfile --adapter caddyfile $cmd_log" & 77 | sleep 3 78 | i_app_keep -t -name="caddy" -pidof="caddy" -cpath="/opt/caddy/caddy" 79 | 80 | #caddy_get_status 81 | eval "$scriptfilepath keep &" 82 | exit 0 83 | } 84 | 85 | initconfig () { 86 | 87 | app_11="/etc/storage/app_11.sh" 88 | if [ -z "$(cat "$app_11" | grep /etc/storage/app_11.sh)" ] ; then 89 | rm -f "$app_11" 90 | fi 91 | if [ ! -f "$app_11" ] || [ ! -s "$app_11" ] ; then 92 | cat > "$app_11" <<-\EEE 93 | # 此脚本路径:/etc/storage/app_11.sh 94 | { # 全局配置 95 | order cgi before respond # 启动 cgi 模块 # 全局配置 96 | order webdav before file_server # 启动 webdav 模块 # 全局配置 97 | admin off # 关闭 API 端口 # 全局配置 98 | } # 全局配置 99 | 100 | :12321 { 101 | root * /opt/caddy/www 102 | file_server 103 | log { 104 | output file /opt/caddy/requests.log { 105 | roll_size 1MiB 106 | roll_local_time 107 | roll_keep 5 108 | roll_keep_for 120h 109 | } 110 | } 111 | } 112 | 113 | # :12322 { 114 | # webdav * { 115 | # root /opt/caddy/www 116 | # } 117 | # } 118 | 119 | EEE 120 | chmod 755 "$app_11" 121 | fi 122 | 123 | } 124 | 125 | initconfig 126 | 127 | update_app () { 128 | 129 | mkdir -p /opt/app/caddy 130 | if [ "$1" = "del" ] ; then 131 | rm -rf /opt/app/caddy/Advanced_Extensions_caddy.asp 132 | rm -rf /opt/caddy/caddy 133 | fi 134 | 135 | initconfig 136 | 137 | # 加载程序配置页面 138 | if [ ! -f "/opt/app/caddy/Advanced_Extensions_caddy.asp" ] || [ ! -s "/opt/app/caddy/Advanced_Extensions_caddy.asp" ] ; then 139 | wgetcurl.sh /opt/app/caddy/Advanced_Extensions_caddy.asp "$hiboyfile/Advanced_Extensions_caddyasp" "$hiboyfile2/Advanced_Extensions_caddyasp" 140 | fi 141 | umount /www/Advanced_Extensions_app26.asp 142 | mount --bind /opt/app/caddy/Advanced_Extensions_caddy.asp /www/Advanced_Extensions_app26.asp 143 | # 更新程序启动脚本 144 | 145 | [ "$1" = "del" ] && /etc/storage/www_sh/caddy del & 146 | } 147 | 148 | case $ACTION in 149 | start) 150 | caddy_close 151 | caddy_check 152 | ;; 153 | check) 154 | caddy_check 155 | ;; 156 | stop) 157 | caddy_close 158 | ;; 159 | updateapp26) 160 | caddy_restart o 161 | [ "$caddy_enable" = "1" ] && nvram set caddy_status="updatecaddy" && logger -t "【caddy】" "重启" && caddy_restart 162 | [ "$caddy_enable" != "1" ] && nvram set caddy_v="" && logger -t "【caddy】" "更新" && update_app del 163 | ;; 164 | update_app) 165 | update_app 166 | ;; 167 | keep) 168 | #caddy_check 169 | caddy_keep 170 | ;; 171 | *) 172 | caddy_check 173 | ;; 174 | esac 175 | 176 | -------------------------------------------------------------------------------- /script/Sh88_ddns_go.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | ddnsgo_enable=`nvram get app_45` 5 | [ -z $ddnsgo_enable ] && ddnsgo_enable=0 && nvram set app_45=0 6 | ddnsgo_usage="$(nvram get app_138)" 7 | [ -z "$ddnsgo_usage" ] && ddnsgo_usage="-l :9877 -f 600 -c /etc/storage/app_35.sh -skipVerify" && nvram set app_138="$ddnsgo_usage" 8 | if [ "$ddnsgo_enable" != "0" ] ; then 9 | 10 | ddnsgo_renum=`nvram get ddnsgo_renum` 11 | ddnsgo_renum=${ddnsgo_renum:-"0"} 12 | 13 | cmd_log_enable=`nvram get cmd_log_enable` 14 | cmd_name="ddnsgo" 15 | cmd_log="" 16 | if [ "$cmd_log_enable" = "1" ] || [ "$ddnsgo_renum" -gt "0" ] ; then 17 | cmd_log="$cmd_log2" 18 | fi 19 | 20 | fi 21 | 22 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep ddns_go)" ] && [ ! -s /tmp/script/_app25 ] ; then 23 | mkdir -p /tmp/script 24 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app25 25 | chmod 777 /tmp/script/_app25 26 | fi 27 | 28 | ddnsgo_restart () { 29 | i_app_restart "$@" -name="ddnsgo" 30 | } 31 | 32 | ddnsgo_get_status () { 33 | 34 | B_restart="$ddnsgo_enable$ddnsgo_usage" 35 | 36 | i_app_get_status -name="ddnsgo" -valb="$B_restart" 37 | } 38 | 39 | ddnsgo_check () { 40 | 41 | ddnsgo_get_status 42 | if [ "$ddnsgo_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 43 | [ ! -z "$(ps -w | grep "ddnsgo" | grep -v grep )" ] && logger -t "【ddnsgo】" "停止 ddnsgo" && ddnsgo_close 44 | { kill_ps "$scriptname" exit0; exit 0; } 45 | fi 46 | if [ "$ddnsgo_enable" = "1" ] ; then 47 | if [ "$needed_restart" = "1" ] ; then 48 | ddnsgo_close 49 | ddnsgo_start 50 | else 51 | [ "$ddnsgo_enable" = "1" ] && [ -z "$(ps -w | grep "ddnsgo" | grep -v grep )" ] && ddnsgo_restart 52 | fi 53 | fi 54 | } 55 | 56 | ddnsgo_keep () { 57 | i_app_keep -name="ddnsgo" -pidof="ddnsgo" & 58 | } 59 | 60 | ddnsgo_close () { 61 | sed -Ei '/【ddnsgo】|^$/d' /tmp/script/_opt_script_check 62 | killall ddnsgo 63 | kill_ps "/tmp/script/_app25" 64 | kill_ps "_ddns_go.sh" 65 | kill_ps "$scriptname" 66 | } 67 | 68 | ddnsgo_start () { 69 | check_webui_yes 70 | i_app_get_cmd_file -name="ddnsgo" -cmd="ddnsgo" -cpath="/opt/bin/ddnsgo" -down1="$hiboyfile/ddnsgo" -down2="$hiboyfile2/ddnsgo" 71 | logger -t "【ddnsgo】" "运行 $SVC_PATH" 72 | eval "$SVC_PATH $ddnsgo_usage $cmd_log" & 73 | sleep 4 74 | i_app_keep -t -name="ddnsgo" -pidof="ddnsgo" 75 | 76 | #ddnsgo_get_status 77 | eval "$scriptfilepath keep &" 78 | exit 0 79 | } 80 | 81 | initconfig () { 82 | 83 | app_35="/etc/storage/app_35.sh" 84 | if [ ! -f "$app_35" ] || [ ! -s "$app_35" ] ; then 85 | cat > "$app_35" <<-\EEE 86 | notallowwanaccess: true 87 | 88 | EEE 89 | chmod 755 "$app_35" 90 | fi 91 | 92 | } 93 | 94 | initconfig 95 | 96 | update_app () { 97 | 98 | mkdir -p /opt/app/ddnsgo 99 | if [ "$1" = "del" ] ; then 100 | rm -rf /opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp 101 | rm -rf /opt/bin/ddnsgo /opt/opt_backup/bin/ddnsgo 102 | fi 103 | 104 | initconfig 105 | 106 | # 加载程序配置页面 107 | if [ ! -f "/opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp" ] || [ ! -s "/opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp" ] ; then 108 | wgetcurl.sh /opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp "$hiboyfile/Advanced_Extensions_ddnsgoasp" "$hiboyfile2/Advanced_Extensions_ddnsgoasp" 109 | fi 110 | umount /www/Advanced_Extensions_app25.asp 111 | mount --bind /opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp /www/Advanced_Extensions_app25.asp 112 | # 更新程序启动脚本 113 | 114 | [ "$1" = "del" ] && /etc/storage/www_sh/ddnsgo del & 115 | } 116 | 117 | case $ACTION in 118 | start) 119 | ddnsgo_close 120 | ddnsgo_check 121 | ;; 122 | check) 123 | ddnsgo_check 124 | ;; 125 | stop) 126 | ddnsgo_close 127 | ;; 128 | updateapp25) 129 | ddnsgo_restart o 130 | [ "$ddnsgo_enable" = "1" ] && nvram set ddnsgo_status="updateddnsgo" && logger -t "【ddnsgo】" "重启" && ddnsgo_restart 131 | [ "$ddnsgo_enable" != "1" ] && nvram set ddnsgo_v="" && logger -t "【ddnsgo】" "更新" && update_app del 132 | ;; 133 | update_app) 134 | update_app 135 | ;; 136 | keep) 137 | #ddnsgo_check 138 | ddnsgo_keep 139 | ;; 140 | *) 141 | ddnsgo_check 142 | ;; 143 | esac 144 | 145 | -------------------------------------------------------------------------------- /script/Sh90_ddns_to.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | ddnsto_enable=`nvram get app_64` 5 | [ -z $ddnsto_enable ] && ddnsto_enable=0 && nvram set app_64=0 6 | ddnsto_token=`nvram get app_65` 7 | if [ "$ddnsto_enable" != "0" ] ; then 8 | 9 | ddnsto_renum=`nvram get ddnsto_renum` 10 | ddnsto_renum=${ddnsto_renum:-"0"} 11 | 12 | upPassword="" 13 | 14 | cmd_log_enable=`nvram get cmd_log_enable` 15 | cmd_name="ddnsto" 16 | cmd_log="" 17 | if [ "$cmd_log_enable" = "1" ] || [ "$ddnsto_renum" -gt "0" ] ; then 18 | cmd_log="$cmd_log2" 19 | fi 20 | 21 | fi 22 | 23 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep ddns_to)" ] && [ ! -s /tmp/script/_app16 ] ; then 24 | mkdir -p /tmp/script 25 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app16 26 | chmod 777 /tmp/script/_app16 27 | fi 28 | 29 | ddnsto_restart () { 30 | i_app_restart "$@" -name="ddnsto" 31 | } 32 | 33 | ddnsto_get_status () { 34 | 35 | B_restart="$ddnsto_enable$ddnsto_token" 36 | 37 | i_app_get_status -name="ddnsto" -valb="$B_restart" 38 | } 39 | 40 | ddnsto_check () { 41 | 42 | ddnsto_get_status 43 | if [ "$ddnsto_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 44 | [ ! -z "$(ps -w | grep "ddnsto" | grep -v grep )" ] && logger -t "【ddnsto】" "停止 ddnsto" && ddnsto_close 45 | { kill_ps "$scriptname" exit0; exit 0; } 46 | fi 47 | if [ "$ddnsto_enable" = "1" ] ; then 48 | if [ "$needed_restart" = "1" ] ; then 49 | ddnsto_close 50 | ddnsto_start 51 | else 52 | [ "$ddnsto_enable" = "1" ] && [ -z "$(ps -w | grep "ddnsto" | grep -v grep )" ] && ddnsto_restart 53 | fi 54 | fi 55 | } 56 | 57 | ddnsto_keep () { 58 | i_app_keep -name="ddnsto" -pidof="ddnsto" & 59 | } 60 | 61 | ddnsto_close () { 62 | kill_ps "$scriptname keep" 63 | sed -Ei '/【ddnsto】|^$/d' /tmp/script/_opt_script_check 64 | killall ddnsto 65 | kill_ps "/tmp/script/_app16" 66 | kill_ps "_ddns_to.sh" 67 | kill_ps "$scriptname" 68 | } 69 | 70 | ddnsto_start () { 71 | 72 | check_webui_yes 73 | i_app_get_cmd_file -name="ddnsto" -cmd="ddnsto" -cpath="/opt/bin/ddnsto" -down1="$hiboyfile/ddnsto" -down2="$hiboyfile2/ddnsto" 74 | [ ! -s "$SVC_PATH" ] && wgetcurl_file "$SVC_PATH" "https://fw0.koolcenter.com/binary/ddnsto/linux/mipsel/ddnsto" 75 | ddnsto_route_id=$(ddnsto -w | awk '{print $2}') 76 | nvram set ddnsto_route_id="$ddnsto_route_id" 77 | [ ! -z $ddnsto_route_id ] && logger -t "【ddnsto】" "路由器ID:【$ddnsto_route_id】;管理控制台 https://www.ddnsto.com/" 78 | ddnsto_version=$(ddnsto -v) 79 | nvram set ddnsto_version="$ddnsto_version" 80 | [ -z $ddnsto_token ] && logger -t "【ddnsto】" "【ddnsto_token】不能为空,启动失败, 10 秒后自动尝试重新启动" && sleep 10 && ddnsto_restart x 81 | logger -t "【ddnsto】" "运行 ddnsto 版本:$ddnsto_version" 82 | eval "ddnsto -u $ddnsto_token -d $cmd_log" & 83 | sleep 3 84 | i_app_keep -t -name="ddnsto" -pidof="ddnsto" 85 | sleep 2 86 | ddnsto_route_id=$(ddnsto -w | awk '{print $2}') 87 | nvram set ddnsto_route_id="$ddnsto_route_id" 88 | [ ! -z $ddnsto_route_id ] && logger -t "【ddnsto】" "路由器ID:【$ddnsto_route_id】;管理控制台 https://www.ddnsto.com/" 89 | [ -z $ddnsto_route_id ] && logger -t "【ddnsto】" "路由器ID:【$ddnsto_route_id】不能为空,启动失败, 10 秒后自动尝试重新启动" && sleep 10 && ddnsto_restart x 90 | eval "$scriptfilepath keep &" 91 | exit 0 92 | 93 | } 94 | 95 | initconfig () { 96 | 97 | echo "ddnsto initconfig" 98 | } 99 | 100 | initconfig 101 | 102 | update_app () { 103 | mkdir -p /opt/app/ddnsto 104 | if [ "$1" = "update_asp" ] ; then 105 | rm -rf /opt/app/ddnsto/Advanced_Extensions_ddnsto.asp 106 | fi 107 | if [ "$1" = "del" ] ; then 108 | rm -rf /opt/app/ddnsto/Advanced_Extensions_ddnsto.asp 109 | [ -f /opt/bin/ddnsto ] && rm -f /opt/bin/ddnsto /opt/opt_backup/bin/ddnsto 110 | [ -f /etc_ro/ddnsto ] && touch /tmp/ddnsto_ro 111 | fi 112 | 113 | initconfig 114 | 115 | # 加载程序配置页面 116 | if [ ! -f "/opt/app/ddnsto/Advanced_Extensions_ddnsto.asp" ] || [ ! -s "/opt/app/ddnsto/Advanced_Extensions_ddnsto.asp" ] ; then 117 | wgetcurl.sh /opt/app/ddnsto/Advanced_Extensions_ddnsto.asp "$hiboyfile/Advanced_Extensions_ddnstoasp" "$hiboyfile2/Advanced_Extensions_ddnstoasp" 118 | fi 119 | umount /www/Advanced_Extensions_app16.asp 120 | mount --bind /opt/app/ddnsto/Advanced_Extensions_ddnsto.asp /www/Advanced_Extensions_app16.asp 121 | # 更新程序启动脚本 122 | 123 | [ "$1" = "del" ] && /etc/storage/www_sh/ddnsto del & 124 | } 125 | 126 | case $ACTION in 127 | start) 128 | ddnsto_close 129 | ddnsto_check 130 | ;; 131 | check) 132 | ddnsto_check 133 | ;; 134 | stop) 135 | ddnsto_close 136 | ;; 137 | updateapp16) 138 | ddnsto_restart o 139 | [ "$ddnsto_enable" = "1" ] && nvram set ddnsto_status="updateddnsto" && logger -t "【ddnsto】" "重启" && ddnsto_restart 140 | [ "$ddnsto_enable" != "1" ] && nvram set ddnsto_version="" && logger -t "【ddnsto】" "更新" && update_app del 141 | ;; 142 | update_app) 143 | update_app 144 | ;; 145 | update_asp) 146 | update_app update_asp 147 | ;; 148 | keep) 149 | #ddnsto_check 150 | ddnsto_keep 151 | ;; 152 | *) 153 | ddnsto_check 154 | ;; 155 | esac 156 | 157 | -------------------------------------------------------------------------------- /script/Sh92_arozos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | arozos_enable=`nvram get app_148` 5 | [ -z $arozos_enable ] && arozos_enable=0 && nvram set app_148=0 6 | arozos_usage="$(nvram get app_3)" 7 | [ -z "$(echo $arozos_usage | grep max_upload_size)" ] && arozos_usage="" 8 | [ -z "$arozos_usage" ] && arozos_usage="-port 8680 -max_upload_size 8192 -bufffile_size 25 -buffpool_size 25 -enable_buffpool=true -enable_pwman=false -iobuf 25 -tmp_time 60 -upload_buf 25" && nvram set app_3="$arozos_usage" 9 | 10 | if [ "$arozos_enable" != "0" ] ; then 11 | 12 | arozos_renum=`nvram get arozos_renum` 13 | arozos_renum=${arozos_renum:-"0"} 14 | 15 | cmd_log_enable=`nvram get cmd_log_enable` 16 | cmd_name="arozos" 17 | cmd_log="" 18 | if [ "$cmd_log_enable" = "1" ] || [ "$arozos_renum" -gt "0" ] ; then 19 | cmd_log="$cmd_log2" 20 | fi 21 | 22 | fi 23 | 24 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep arozos)" ] && [ ! -s /tmp/script/_app30 ] ; then 25 | mkdir -p /tmp/script 26 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app30 27 | chmod 777 /tmp/script/_app30 28 | fi 29 | 30 | arozos_restart () { 31 | i_app_restart "$@" -name="arozos" 32 | } 33 | 34 | arozos_get_status () { 35 | 36 | B_restart="$arozos_enable$arozos_usage" 37 | 38 | i_app_get_status -name="arozos" -valb="$B_restart" 39 | } 40 | 41 | arozos_check () { 42 | 43 | arozos_get_status 44 | if [ "$arozos_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 45 | [ ! -z "`pidof arozos`" ] && logger -t "【arozos】" "停止 arozos" && arozos_close 46 | { kill_ps "$scriptname" exit0; exit 0; } 47 | fi 48 | if [ "$arozos_enable" = "1" ] ; then 49 | if [ "$needed_restart" = "1" ] ; then 50 | arozos_close 51 | arozos_start 52 | else 53 | [ "$arozos_enable" = "1" ] && [ -z "`pidof arozos`" ] && arozos_restart 54 | fi 55 | fi 56 | } 57 | 58 | arozos_keep () { 59 | i_app_keep -name="arozos" -pidof="arozos" & 60 | 61 | } 62 | 63 | arozos_close () { 64 | sed -Ei '/【arozos】|^$/d' /tmp/script/_opt_script_check 65 | killall arozos 66 | sleep 2 67 | kill_ps "/tmp/script/_app30" 68 | kill_ps "_arozos.sh" 69 | kill_ps "$scriptname" 70 | } 71 | 72 | arozos_start () { 73 | check_webui_yes 74 | 75 | SVC_PATH="/tmp/AiDisk_00/arozos/arozos" 76 | if [ ! -f $SVC_PATH ] ; then 77 | logger -t "【clash】" "找不到 $SVC_PATH ,安装 opt 程序" 78 | /etc/storage/script/Sh01_mountopt.sh start 79 | mkdir -p /tmp/AiDisk_00/arozos 80 | fi 81 | mkdir -p /tmp/AiDisk_00/arozos 82 | block=$(check_disk_size /tmp/AiDisk_00/arozos) 83 | [ -z "$block" ] && block="0" 84 | [ "$block" != "0" ] && logger -t "【arozos】" "路径 /tmp/AiDisk_00/arozos 剩余空间:$block M" 85 | if [ "$block" != "0" ] && [ ! -z "$block" ] && [ "$block" -lt "1500" ] && [ ! -d "/tmp/AiDisk_00/arozos/web" ] ; then 86 | [ "$block" = "0" ] && logger -t "【arozos】" "错误!!!剩余空间少于 1500M arozos 启动失败" 87 | nvram set app_148=0 88 | eval "$scriptfilepath &" 89 | exit 0 90 | fi 91 | if [ ! -s "$SVC_PATH" ] || [ ! -d "/tmp/AiDisk_00/arozos/web" ] ; then 92 | logger -t "【arozos】" "找不到 $SVC_PATH ,安装 arozos 程序" 93 | curltest=`which curl` 94 | if [ -z "$curltest" ] || [ ! -s "`which curl`" ] ; then 95 | tag="$( wget -T 5 -t 3 --user-agent "$user_agent" --max-redirect=0 --output-document=- https://api.github.com/repos/tobychui/arozos/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )" 96 | [ -z "$tag" ] && tag="$( wget -T 5 -t 3 --user-agent "$user_agent" --quiet --output-document=- https://api.github.com/repos/tobychui/arozos/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )" 97 | else 98 | tag="$( curl --connect-timeout 3 --user-agent "$user_agent" https://api.github.com/repos/tobychui/arozos/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )" 99 | [ -z "$tag" ] && tag="$( curl -L --connect-timeout 3 --user-agent "$user_agent" -s https://api.github.com/repos/tobychui/arozos/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )" 100 | fi 101 | [ -f /tmp/AiDisk_00/arozos/arozos_linux_mipsle ] && mv -f /tmp/AiDisk_00/arozos/arozos_linux_mipsle $SVC_PATH 102 | if [ ! -z "$tag" ] && [ ! -s "$SVC_PATH" ] ; then 103 | logger -t "【arozos】" "自动下载最新版本 arozos_linux_mipsle $tag " 104 | wgetcurl.sh "$SVC_PATH" "https://github.com/tobychui/arozos/releases/download/$tag/arozos_linux_mipsle" 105 | fi 106 | if [ ! -z "$tag" ] && [ ! -d "/tmp/AiDisk_00/arozos/web" ] ; then 107 | logger -t "【arozos】" "自动下载最新版本 web.tar.gz $tag" 108 | [ ! -f /tmp/AiDisk_00/arozos/web.tar.gz ] && wgetcurl.sh "/tmp/AiDisk_00/arozos/web.tar.gz" "https://github.com/tobychui/arozos/releases/download/$tag/web.tar.gz" 109 | fi 110 | if [ ! -s "$SVC_PATH" ] && [ ! -d "/tmp/AiDisk_00/arozos/web" ] ; then 111 | logger -t "【arozos】" "最新版本获取失败!!!" 112 | logger -t "【arozos】" "请打开 https://github.com/tobychui/arozos/releases" 113 | logger -t "【arozos】" "手动下载 arozos_linux_mipsle 和 web.tar.gz 文件。" 114 | logger -t "【arozos】" "2个文件文件放到 /tmp/AiDisk_00/arozos 文件夹里面。" 115 | fi 116 | fi 117 | chmod 777 "$SVC_PATH" 118 | cd /tmp/AiDisk_00/arozos 119 | arozos_v="$($SVC_PATH -version | head -n1)" 120 | nvram set arozos_v="$arozos_v" 121 | logger -t "【arozos】" "运行 $SVC_PATH" 122 | [ -f /tmp/AiDisk_00/arozos/web.tar.gz ] && logger -t "【arozos】" "首次运行,解压资源需等待 10-20 分钟" 123 | su_cmd="eval" 124 | su_cmd2="$SVC_PATH $arozos_usage" 125 | eval "$su_cmd" '"cmd_name=arozos ; '"$su_cmd2"' $cmd_log2"' & 126 | sleep 3 127 | i_app_keep -t -name="arozos" -pidof="arozos" 128 | #arozos_get_status 129 | eval "$scriptfilepath keep &" 130 | exit 0 131 | } 132 | 133 | 134 | # initconfig 135 | 136 | update_app () { 137 | 138 | mkdir -p /opt/app/arozos 139 | if [ "$1" = "del" ] ; then 140 | rm -rf /opt/app/arozos/Advanced_Extensions_arozos.asp 141 | rm -rf /tmp/AiDisk_00/arozos/web 142 | rm -rf /tmp/AiDisk_00/arozos/system 143 | rm -rf /tmp/AiDisk_00/arozos/web.tar.gz 144 | rm -rf /tmp/AiDisk_00/arozos/arozos 145 | fi 146 | 147 | # initconfig 148 | 149 | # 加载程序配置页面 150 | if [ ! -f "/opt/app/arozos/Advanced_Extensions_arozos.asp" ] || [ ! -s "/opt/app/arozos/Advanced_Extensions_arozos.asp" ] ; then 151 | wgetcurl.sh /opt/app/arozos/Advanced_Extensions_arozos.asp "$hiboyfile/Advanced_Extensions_arozosasp" "$hiboyfile2/Advanced_Extensions_arozosasp" 152 | fi 153 | umount /www/Advanced_Extensions_app30.asp 154 | mount --bind /opt/app/arozos/Advanced_Extensions_arozos.asp /www/Advanced_Extensions_app30.asp 155 | # 更新程序启动脚本 156 | 157 | [ "$1" = "del" ] && /etc/storage/www_sh/ArozOS del & 158 | } 159 | 160 | case $ACTION in 161 | start) 162 | arozos_close 163 | arozos_check 164 | ;; 165 | check) 166 | arozos_check 167 | ;; 168 | stop) 169 | arozos_close 170 | ;; 171 | updateapp30) 172 | arozos_restart o 173 | [ "$arozos_enable" = "1" ] && nvram set arozos_status="updatearozos" && logger -t "【arozos】" "重启" && arozos_restart 174 | [ "$arozos_enable" != "1" ] && nvram set arozos_v="" && logger -t "【arozos】" "更新" && update_app del 175 | ;; 176 | update_app) 177 | update_app 178 | ;; 179 | keep) 180 | #arozos_check 181 | arozos_keep 182 | ;; 183 | *) 184 | arozos_check 185 | ;; 186 | esac 187 | 188 | -------------------------------------------------------------------------------- /script/Sh93_zoraxy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | zoraxy_enable=`nvram get app_149` 5 | [ -z $zoraxy_enable ] && zoraxy_enable=0 && nvram set app_149=0 6 | zoraxy_usage="$(nvram get app_4)" 7 | [ -z "$(echo $zoraxy_usage | grep '\-port=')" ] && zoraxy_usage="" 8 | [ -z "$zoraxy_usage" ] && zoraxy_usage="-port=:8688" && nvram set app_4="$zoraxy_usage" 9 | 10 | if [ "$zoraxy_enable" != "0" ] ; then 11 | 12 | zoraxy_renum=`nvram get zoraxy_renum` 13 | zoraxy_renum=${zoraxy_renum:-"0"} 14 | 15 | cmd_log_enable=`nvram get cmd_log_enable` 16 | cmd_name="zoraxy" 17 | cmd_log="" 18 | if [ "$cmd_log_enable" = "1" ] || [ "$zoraxy_renum" -gt "0" ] ; then 19 | cmd_log="$cmd_log2" 20 | fi 21 | 22 | fi 23 | 24 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep zoraxy)" ] && [ ! -s /tmp/script/_app31 ] ; then 25 | mkdir -p /tmp/script 26 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app31 27 | chmod 777 /tmp/script/_app31 28 | fi 29 | 30 | zoraxy_restart () { 31 | i_app_restart "$@" -name="zoraxy" 32 | } 33 | 34 | zoraxy_get_status () { 35 | 36 | B_restart="$zoraxy_enable$zoraxy_usage" 37 | 38 | i_app_get_status -name="zoraxy" -valb="$B_restart" 39 | } 40 | 41 | zoraxy_check () { 42 | 43 | zoraxy_get_status 44 | if [ "$zoraxy_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then 45 | [ ! -z "`pidof zoraxy`" ] && logger -t "【zoraxy】" "停止 zoraxy" && zoraxy_close 46 | { kill_ps "$scriptname" exit0; exit 0; } 47 | fi 48 | if [ "$zoraxy_enable" = "1" ] ; then 49 | if [ "$needed_restart" = "1" ] ; then 50 | zoraxy_close 51 | zoraxy_start 52 | else 53 | [ "$zoraxy_enable" = "1" ] && [ -z "`pidof zoraxy`" ] && zoraxy_restart 54 | fi 55 | fi 56 | } 57 | 58 | zoraxy_keep () { 59 | i_app_keep -name="zoraxy" -pidof="zoraxy" & 60 | 61 | } 62 | 63 | zoraxy_close () { 64 | sed -Ei '/【zoraxy】|^$/d' /tmp/script/_opt_script_check 65 | killall zoraxy 66 | sleep 2 67 | kill_ps "/tmp/script/_app31" 68 | kill_ps "_zoraxy.sh" 69 | kill_ps "$scriptname" 70 | } 71 | 72 | zoraxy_start () { 73 | check_webui_yes 74 | 75 | SVC_PATH="/tmp/AiDisk_00/zoraxy/zoraxy" 76 | if [ ! -f $SVC_PATH ] ; then 77 | logger -t "【clash】" "找不到 $SVC_PATH ,安装 opt 程序" 78 | /etc/storage/script/Sh01_mountopt.sh start 79 | mkdir -p /tmp/AiDisk_00/zoraxy 80 | fi 81 | mkdir -p /tmp/AiDisk_00/zoraxy 82 | block=$(check_disk_size /tmp/AiDisk_00/zoraxy) 83 | [ -z "$block" ] && block="0" 84 | [ "$block" != "0" ] && logger -t "【zoraxy】" "路径 /tmp/AiDisk_00/zoraxy 剩余空间:$block M" 85 | if [ "$block" != "0" ] && [ ! -z "$block" ] && [ "$block" -lt "150" ] && [ ! -f "/tmp/AiDisk_00/zoraxy/zoraxy" ] ; then 86 | [ "$block" = "0" ] && logger -t "【zoraxy】" "错误!!!剩余空间少于 150M zoraxy 启动失败" 87 | nvram set app_149=0 88 | eval "$scriptfilepath &" 89 | exit 0 90 | fi 91 | if [ ! -s "$SVC_PATH" ] ; then 92 | logger -t "【zoraxy】" "找不到 $SVC_PATH ,安装 zoraxy 程序" 93 | curltest=`which curl` 94 | if [ -z "$curltest" ] || [ ! -s "`which curl`" ] ; then 95 | tag="$( wget -T 5 -t 3 --user-agent "$user_agent" --max-redirect=0 --output-document=- https://api.github.com/repos/tobychui/zoraxy/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )" 96 | [ -z "$tag" ] && tag="$( wget -T 5 -t 3 --user-agent "$user_agent" --quiet --output-document=- https://api.github.com/repos/tobychui/zoraxy/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )" 97 | else 98 | tag="$( curl --connect-timeout 3 --user-agent "$user_agent" https://api.github.com/repos/tobychui/zoraxy/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )" 99 | [ -z "$tag" ] && tag="$( curl -L --connect-timeout 3 --user-agent "$user_agent" -s https://api.github.com/repos/tobychui/zoraxy/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )" 100 | fi 101 | [ -f /tmp/AiDisk_00/zoraxy/zoraxy_linux_mipsle ] && mv -f /tmp/AiDisk_00/zoraxy/zoraxy_linux_mipsle $SVC_PATH 102 | if [ ! -z "$tag" ] && [ ! -s "$SVC_PATH" ] ; then 103 | logger -t "【zoraxy】" "自动下载最新版本 zoraxy_linux_mipsle $tag " 104 | wgetcurl.sh "$SVC_PATH" "https://github.com/tobychui/zoraxy/releases/download/$tag/zoraxy_linux_mipsle" 105 | fi 106 | if [ ! -s "$SVC_PATH" ] ; then 107 | logger -t "【zoraxy】" "最新版本获取失败!!!" 108 | logger -t "【zoraxy】" "请打开 https://github.com/tobychui/zoraxy/releases" 109 | logger -t "【zoraxy】" "手动下载 zoraxy_linux_mipsle 文件。" 110 | logger -t "【zoraxy】" "文件文件放到 /tmp/AiDisk_00/zoraxy 文件夹里面。" 111 | fi 112 | fi 113 | chmod 777 "$SVC_PATH" 114 | cd /tmp/AiDisk_00/zoraxy 115 | zoraxy_v="$($SVC_PATH -version | head -n1)" 116 | nvram set zoraxy_v="$zoraxy_v" 117 | logger -t "【zoraxy】" "运行 $SVC_PATH" 118 | su_cmd="eval" 119 | su_cmd2="$SVC_PATH $zoraxy_usage" 120 | eval "$su_cmd" '"cmd_name=zoraxy ; '"$su_cmd2"' $cmd_log2"' & 121 | sleep 3 122 | i_app_keep -t -name="zoraxy" -pidof="zoraxy" 123 | #zoraxy_get_status 124 | eval "$scriptfilepath keep &" 125 | exit 0 126 | } 127 | 128 | 129 | # initconfig 130 | 131 | update_app () { 132 | 133 | mkdir -p /opt/app/zoraxy 134 | if [ "$1" = "del" ] ; then 135 | rm -rf /opt/app/zoraxy/Advanced_Extensions_zoraxy.asp 136 | rm -rf /tmp/AiDisk_00/zoraxy/zoraxy 137 | fi 138 | 139 | # initconfig 140 | 141 | # 加载程序配置页面 142 | if [ ! -f "/opt/app/zoraxy/Advanced_Extensions_zoraxy.asp" ] || [ ! -s "/opt/app/zoraxy/Advanced_Extensions_zoraxy.asp" ] ; then 143 | wgetcurl.sh /opt/app/zoraxy/Advanced_Extensions_zoraxy.asp "$hiboyfile/Advanced_Extensions_zoraxyasp" "$hiboyfile2/Advanced_Extensions_zoraxyasp" 144 | fi 145 | umount /www/Advanced_Extensions_app31.asp 146 | mount --bind /opt/app/zoraxy/Advanced_Extensions_zoraxy.asp /www/Advanced_Extensions_app31.asp 147 | # 更新程序启动脚本 148 | 149 | [ "$1" = "del" ] && /etc/storage/www_sh/Zoraxy del & 150 | } 151 | 152 | case $ACTION in 153 | start) 154 | zoraxy_close 155 | zoraxy_check 156 | ;; 157 | check) 158 | zoraxy_check 159 | ;; 160 | stop) 161 | zoraxy_close 162 | ;; 163 | updateapp31) 164 | zoraxy_restart o 165 | [ "$zoraxy_enable" = "1" ] && nvram set zoraxy_status="updatezoraxy" && logger -t "【zoraxy】" "重启" && zoraxy_restart 166 | [ "$zoraxy_enable" != "1" ] && nvram set zoraxy_v="" && logger -t "【zoraxy】" "更新" && update_app del 167 | ;; 168 | update_app) 169 | update_app 170 | ;; 171 | keep) 172 | #zoraxy_check 173 | zoraxy_keep 174 | ;; 175 | *) 176 | zoraxy_check 177 | ;; 178 | esac 179 | 180 | -------------------------------------------------------------------------------- /script/sh_0_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | #/etc/storage/script/sh_0_script.sh 4 | #/etc/storage/script_script.sh 5 | source /etc/storage/script/init.sh 6 | [ -f /tmp/script.lock ] && exit 0 7 | kill_ps "sh_0_script.sh" 8 | mkdir -p /tmp/ss_tproxy/dnsmasq.d 9 | rm -f /tmp/webui_yes 10 | rm -f /tmp/script/_opt_script_check 11 | touch /tmp/script.lock 12 | touch /tmp/script_script_yes 13 | [ ! -z "$(cat /tmp/syslog.log | grep "SPI flash chip"| grep 32768)" ] && { nvram set cmd_reboot_enable=1 ; nvram commit ; nvram save ; } 14 | source /etc/storage/script0_script.sh 15 | ln -sf "/etc/storage/PhMain.ini" "/etc/PhMain.ini" 16 | ln -sf "/etc/storage/init.status" "/etc/init.status" 17 | rm -f "/opt/etc/init.d/S96sh3.sh" 18 | echo "" > /var/log/shadowsocks_watchdog.log 19 | echo "" > /var/log/Pcap_DNSProxy_watchdog.log 20 | echo "" > /var/log/chinadns_watchdog.log 21 | echo 0 > /proc/sys/net/ipv4/tcp_tw_recycle 22 | export PATH='/etc/storage/bin:/tmp/script:/etc/storage/script:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin' 23 | export LD_LIBRARY_PATH=/lib:/opt/lib 24 | sed -Ei '/github|ipip.net|_vlmcs._tcp|txt-record=_jetbrains-license-server.lan|adbyby_host.conf|cflist.conf|accelerated-domains|no-resolv|server=127.0.0.1|dns-forward-max=1000|min-cache-ttl=1800|ss_tproxy|chinadns_ng|chinadns_0/d' /etc/storage/dnsmasq/dnsmasq.conf 25 | sed ":a;N;s/\n\n\n/\n\n/g;ba" -i /etc/storage/dnsmasq/dnsmasq.conf 26 | sed -Ei "/\/tmp\/ss\/dnsmasq.d/d" /etc/storage/dnsmasq/dnsmasq.conf 27 | rm -rf /tmp/ss/dnsmasq.d/* 28 | #killall crond 29 | restart_on_dhcpd 30 | [ -f /tmp/menu_title_re ] && /etc/storage/www_sh/menu_title.sh re & 31 | mkdir -p /tmp/script 32 | { echo '#!/bin/bash' ; echo /etc/storage/script/Sh01_mountopt.sh '"$@"' ; } > /tmp/script/_mountopt 33 | chmod 777 /tmp/script/_mountopt 34 | nvram set ss_internet="0" 35 | /etc/storage/script/sh_ezscript.sh connAPSite 36 | /etc/storage/script/Sh??_mento_hust.sh & 37 | ping_text=`ping -4 223.5.5.5 -c 1 -w 4 -q` 38 | ping_time=`echo $ping_text | awk -F '/' '{print $4}'| awk -F '.' '{print $1}'` 39 | ping_loss=`echo $ping_text | awk -F ', ' '{print $3}' | awk '{print $1}'` 40 | if [ ! -z "$ping_time" ] ; then 41 | echo "ping:$ping_time ms 丢包率:$ping_loss" 42 | else 43 | echo "ping:失效" 44 | fi 45 | rb=1 46 | while [ -z "$ping_time" ]; 47 | do 48 | logger -t "【自定义脚本】" "等待联网后开始脚本" 49 | sleep 8 50 | 51 | ping_text=`ping -4 223.5.5.5 -c 1 -w 4 -q` 52 | ping_time=`echo $ping_text | awk -F '/' '{print $4}'| awk -F '.' '{print $1}'` 53 | ping_loss=`echo $ping_text | awk -F ', ' '{print $3}' | awk '{print $1}'` 54 | if [ ! -z "$ping_time" ] ; then 55 | echo "ping:$ping_time ms 丢包率:$ping_loss" 56 | else 57 | echo "ping:失效" 58 | fi 59 | rb=`expr $rb + 1` 60 | if [ "$rb" -gt 3 ] ; then 61 | logger -t "【自定义脚本】" "等待联网超时" 62 | ping_time=200 63 | break 64 | fi 65 | done 66 | /etc/storage/ap_script.sh crontabs 67 | [ -d /etc/storage/script ] && chmod 777 /etc/storage/script -R 68 | /etc/storage/script/Sh01_mountopt.sh upopt 69 | /etc/storage/script/sh_upscript.sh 70 | /etc/storage/www_sh/menu_title.sh & 71 | /etc/storage/script/Sh01_mountopt.sh libmd5_check 72 | /tmp/sh_theme.sh & 73 | stop_aria 74 | run_aria 75 | stop_transmission 76 | run_transmission 77 | stop_nfsd 78 | run_nfsd 79 | rm -f /tmp/cron_adb.lock 80 | [ ! -f /etc/storage/PhMain.ini ] && touch /etc/storage/PhMain.ini 81 | [ ! -f /etc/storage/init.status ] && touch /etc/storage/init.status 82 | rm -f /tmp/webui_yes 83 | /etc/storage/script/sh_opt_script_check.sh 84 | chmod 777 /tmp/script -R 85 | touch /tmp/webui_yes 86 | /etc/storage/www_sh/menu_title.sh & 87 | # extend path to /opt 88 | for i in /opt/etc/init.d/_* ; do 89 | rm -f ${i} 90 | done 91 | for i in /opt/etc/init.d/Sh??_* ; do 92 | rm -f ${i} 93 | done 94 | # start all services S* in /opt/etc/init.d 95 | for i in /opt/etc/init.d/S??* ; do 96 | [ ! -x "${i}" ] && continue 97 | [ ! -f /tmp/webui_yes ] && continue 98 | ${i} start 99 | done 100 | sw_mode=`nvram get sw_mode` 101 | [ "$sw_mode" != "3" ] && restart_firewall & 102 | [ "$sw_mode" == "3" ] && /etc/storage/crontabs_script.sh & 103 | rm -f /tmp/script.lock 104 | [ -f /tmp/www_asp_re ] && /etc/storage/script/sh_upscript.sh www_asp_re & 105 | aria_enable=`nvram get aria_enable` 106 | [ "$aria_enable" == "1" ] && aria.sh start 107 | trmd_enable=`nvram get trmd_enable` 108 | [ "$trmd_enable" == "1" ] && transmission.sh start 109 | logger -t "【自定义脚本】" "初始化脚本完成" 110 | -------------------------------------------------------------------------------- /script/sh_emi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | if [ ! -s /tmp/script/_emi ] && [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep emi)" ] ; then 6 | mkdir -p /tmp/script 7 | cp -f $scriptfilepath /tmp/script/_emi 8 | chmod 777 /tmp/script/_emi 9 | fi 10 | 11 | 12 | logger -t "script_check" "检测到 电磁干扰【EMI】, 15秒后重新启动某些程序" 13 | sleep 15 14 | nvram set display_status=00 15 | nvram set ssrserver_status=00 16 | chmod 777 /etc/storage/script -R 17 | logger -t "【WebUI】" "UI 开关遍历状态监测" 18 | # start all services Sh??_* in /etc/storage/script 19 | for i in /etc/storage/script/Sh??_* ; do 20 | [ ! -x "${i}" ] && continue 21 | eval ${i} 22 | done 23 | killall menu_title.sh 24 | [ -f /etc/storage/www_sh/menu_title.sh ] && /etc/storage/www_sh/menu_title.sh 25 | -------------------------------------------------------------------------------- /script/sh_opt_script_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | if [ ! -s /tmp/script/_opt_script_check ] && [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep opt_script_check)" ] ; then 6 | mkdir -p /tmp/script 7 | cp -f $scriptfilepath /tmp/script/_opt_script_check 8 | chmod 777 /tmp/script/_opt_script_check 9 | exit 10 | fi 11 | 12 | crond_enable=`nvram get crond_enable` 13 | crond_f="/etc/storage/cron/crontabs" 14 | crond_f="$crond_f/`nvram get http_username`" 15 | if [ ! -z "$(grep "#cru\.sh#" $crond_f)" ] && [ "$crond_enable" != "1" ] ; then 16 | nvram set crond_enable=1 17 | crond_enable=1 18 | fi 19 | if [ -z "`pidof crond`" ] && [ "$crond_enable" == "1" ] ; then 20 | crond_log=`nvram get crond_log` 21 | if [ "$crond_log" == "1" ] ; then 22 | crond -d8 23 | else 24 | crond 25 | fi 26 | fi 27 | 28 | opt_script_check=`nvram get opt_script_check` 29 | opt_script_check=$((opt_script_check - 1)) 30 | nvram settmp opt_script_check="$opt_script_check" 31 | if [ "$opt_script_check" -lt 1 ] ; then 32 | nvram settmp opt_script_check="5" 33 | ip6_neighbor_get 34 | ip6_service=`nvram get ip6_service` 35 | if [ ! -z "$ip6_service" ] ; then 36 | dhcp_dnsv6_x=`nvram get dhcp_dnsv6_x` 37 | if [ "$dhcp_dnsv6_x" == "br0" ] ; then 38 | addr6_lan1="$(ifconfig -a br0 | grep inet6 | grep Link | sed -n '1p' | awk '{print $3}' | awk -F '/' '{print $1}')" 39 | addr6_lan2="$(ifconfig -a br0 | grep inet6 | grep Global | sed -n '$p' | awk '{print $3}' | awk -F '/' '{print $1}')" 40 | if [ ! -z "$addr6_lan1" ] && [ -z "$(cat /etc/dnsmasq.conf | grep ${addr6_lan1})" ] ; then 41 | restart_on_dhcpd 42 | else 43 | if [ ! -z "$addr6_lan2" ] && [ -z "$(cat /etc/dnsmasq.conf | grep ${addr6_lan2})" ] ; then 44 | restart_on_dhcpd 45 | fi 46 | fi 47 | fi 48 | fi 49 | fi 50 | 51 | syslog_tmp="`cat /tmp/syslog.log | grep "EMI\?\|dnsmasq is missing,"`" 52 | dnsmasq_tmp="`echo "$syslog_tmp" | grep 'dnsmasq is missing,'`" 53 | if [ ! -z "$dnsmasq_tmp" ] ; then 54 | dnsmasq_tmp2="`echo "$dnsmasq_tmp" | grep 'dnsmasq is missing, start again!'`" 55 | if [ ! -z "$dnsmasq_tmp2" ] ; then 56 | echo -n 1 >> /tmp/dnsmasq_missing1.txt 57 | else 58 | echo -n 0 >> /tmp/dnsmasq_missing0.txt 59 | fi 60 | if [ ! -z "`cat /tmp/dnsmasq_missing1.txt | grep "1111"`" ] ; then 61 | logger -t "script_check" "检测到【dnsmasq】错误【dnsmasq is missing】" 62 | logger -t "script_check" "重置【dnsmasq配置】等待人类排查错误!" 63 | rm -rf /etc/storage/dnsmasq/* 64 | mtd_storage.sh fill 65 | rm -f /tmp/dnsmasq_missing0.txt /tmp/dnsmasq_missing1.txt 66 | echo -n "" > /tmp/dnsmasq_missing0.txt 67 | echo -n "" > /tmp/dnsmasq_missing1.txt 68 | restart_on_dhcpd 69 | sleep 1 70 | sed "s/dnsmasq is missing,/【dnsmasq is missing】,/" -Ei /tmp/syslog.log 71 | else 72 | if [ ! -z "`cat /tmp/dnsmasq_missing0.txt | grep "0000000000"`" ] ; then 73 | rm -f /tmp/dnsmasq_missing0.txt /tmp/dnsmasq_missing1.txt 74 | echo -n "" > /tmp/dnsmasq_missing0.txt 75 | echo -n "" > /tmp/dnsmasq_missing1.txt 76 | sed "s/dnsmasq is missing,/【dnsmasq is missing】,/" -Ei /tmp/syslog.log 77 | else 78 | sed "s/dnsmasq is missing, start again!/dnsmasq is missing,start again!/" -Ei /tmp/syslog.log 79 | fi 80 | fi 81 | fi 82 | EMI_tmp="`echo "$syslog_tmp" | grep 'EMI?'`" 83 | if [ ! -z "$EMI_tmp" ] ; then 84 | logger -t "script_check" "检测到 电磁干扰【EMI】" 85 | sleep 1 86 | sed "s/EMI\?/EMI/" -Ei /tmp/syslog.log 87 | if [ -s /tmp/script/_emi ] ; then 88 | /tmp/script/_emi & 89 | exit 90 | else 91 | [ -s /etc/storage/script/sh_emi.sh ] && /etc/storage/script/sh_emi.sh & 92 | exit 93 | fi 94 | fi 95 | 96 | cmd_cpu_enable=`nvram get cmd_cpu_enable` 97 | if [ "$cmd_cpu_enable" == "1" ] ; then 98 | if [ -f /tmp/top ] ; then 99 | rm -f /tmp/top 100 | else 101 | top -n 1 | grep " R " | grep -v "top -n 1" | grep -v "grep" | grep -v "mtd_write" | grep -v "/usr/sbin/httpd" | grep -v "/usr/sbin/dropbear" | sed -e "s@^@#@g" > /tmp/top 102 | 103 | top -n 1 | grep " S " | grep -v "top -n 1" | grep -v "grep" | grep -v "mtd_write" | grep -v "/usr/sbin/httpd" | grep -v "/usr/sbin/dropbear" | sed -e "s@^@#@g" >> /tmp/top 104 | 105 | if [ -s /tmp/top ] ; then 106 | #21445 21444 admin R 1972 0.4 2 24.9 COMMAND 107 | # 810 30601 admin R 1588 0.3 3 2.2 top -n 1 108 | 109 | while read line 110 | do 111 | if [ ! -z "$line" ] ; then 112 | top_PID="$(echo "$line" | awk '{print substr($0,2,5)}')" 113 | top_COMMAND="$(echo ${line: 47: 34})" 114 | top_CPU=$(echo ${line: 42: 2}) 115 | threads=$(cat /proc/cpuinfo | grep 'processor' | wc -l) 116 | [ -z $threads ] && threads=1 117 | max_cpu=`expr 100 / $threads - 6 ` 118 | if [ $max_cpu -lt $top_CPU ] && [ "$top_CPU" != "0" ] ; then 119 | if [ -z "$(cat /tmp/top_run | grep $top_PID©)" ] ; then 120 | #logger -t "script_check" "检测到进程 PID【$top_PID】使用CPU $top_CPU% 进入防卡CPU检测序列 $top_COMMAND" 121 | #©§ 122 | echo "$top_PID©$top_CPU©§1§$top_COMMAND" >> /tmp/top_run 123 | fi 124 | else 125 | sed -Ei "/^[ \t]*$top_PID©/d" /tmp/top_run 126 | fi 127 | fi 128 | done < /tmp/top 129 | 130 | if [ -s /tmp/top_run ] ; then 131 | sed -Ei "/^$/d" /tmp/top_run 132 | while read line 133 | do 134 | if [ ! -z "$line" ] ; then 135 | top_PID="$(echo "$line" | awk -F '©' '{print $1}')" 136 | top_CPU="$(echo "$line" | awk -F '©' '{print $2}')" 137 | top_COMMAND="$(echo "$line" | awk -F '§' '{print $3}')" 138 | [ ! -f /tmp/top ] && top -n 1 | grep " R " | grep -v "top -n 1" | grep -v "grep" | sed -e "s@^@#@g" > /tmp/top 139 | [ ! -f /tmp/top ] && top -n 1 | grep " S " | grep -v "top -n 1" | grep -v "grep" | sed -e "s@^@#@g" >> /tmp/top 140 | if [ -z "$(cat /tmp/top | grep "$top_PID ")" ] ; then 141 | sed -Ei "/^[ \t]*$top_PID©/d" /tmp/top_run 142 | break 143 | #continue 144 | fi 145 | top_i="$(echo "$line" | awk -F '§' '{print $2}')" 146 | top_2i=`expr $top_i + 1` 147 | if [ $top_2i -eq 9 ] ; then 148 | logger -t "script_check" "检测到进程 PID【$top_PID】使用CPU $top_CPU% 进入防卡CPU检测序列 $top_COMMAND" 149 | fi 150 | if [ $top_2i -gt 100 ] ; then 151 | run_c="$(ps -w | grep "$top_PID " | grep "$top_COMMAND" | grep -v grep | head -n1 | awk -F " " '{for(i=5;i<=NF;++i) sum=sum" "$i}END{print sum}' )" 152 | if [ ! -z "$run_c" ] ; then 153 | kill $top_PID 154 | kill -9 $top_PID 155 | sleep 1 156 | eval "$run_c" & 157 | fi 158 | logger -t "script_check" "检测到进程 PID【$top_PID】 $top_COMMAND" 159 | logger -t "script_check" "已经连续使用CPU $top_CPU% 大于33分钟,尝试 kill 进程防卡CPU" 160 | sed -Ei "/^[ \t]*$top_PID©/d" /tmp/top_run 161 | else 162 | sed -e "s@^[ \t]*$top_PID©$top_CPU©§$top_i§@$top_PID©$top_CPU©§$top_2i§@g" -i /tmp/top_run 163 | fi 164 | fi 165 | done < /tmp/top_run 166 | fi 167 | fi 168 | fi 169 | fi 170 | 171 | ps -w > /tmp/ps 172 | [ ! -f /tmp/webui_yes ] && exit 0 173 | 174 | -------------------------------------------------------------------------------- /script/sh_upscript.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | #nvramshow=`nvram showall | grep '=' | grep script | awk '{print gensub(/'"'"'/,"'"'"'\"'"'"'\"'"'"'","g",$0);}'| awk '{print gensub(/=/,"='\''",1,$0)"'\'';";}'` && eval $nvramshow 5 | upscript_enable=`nvram get upscript_enable` 6 | scriptt=`nvram get scriptt` 7 | scripto=`nvram get scripto` 8 | [ "$ACTION" = "upscript" ] && upscript_enable=1 9 | 10 | if [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep _upscript)" ] && [ ! -s /tmp/script/_upscript ] ; then 11 | mkdir -p /tmp/script 12 | { echo '#!/bin/bash' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_upscript 13 | chmod 777 /tmp/script/_upscript 14 | fi 15 | 16 | file_o_check () { 17 | 18 | #获取script的sh*文件MD5 19 | eval $(md5sum `/usr/bin/find /etc/storage/script/ -perm '-u+x' -name '*.sh' | sort -r` | awk '{print $2"_o="$1;}' | awk -F '/' '{print $NF;}' | sed 's/\.sh//g') 20 | } 21 | 22 | file_t_check () { 23 | 24 | #获取最新script的sh*文件MD5 25 | rm -f /tmp/scriptsh.txt 26 | wgetcurl.sh "/tmp/scriptsh.txt" "$hiboyscript/scriptsh.txt" "$hiboyscript2/scriptsh.txt" 27 | if [ ! -s /tmp/scriptsh.txt ] || [ -z "$(cat /tmp/scriptsh.txt | grep "sh_upscript")" ] || [ -z "$(cat /tmp/scriptsh.txt | grep "scriptt")" ] ; then 28 | /etc/storage/script/Sh01_mountopt.sh re_ca_tmp 29 | source /etc/storage/script/init.sh 30 | wgetcurl.sh "/tmp/scriptsh.txt" "$hiboyscript/scriptsh.txt" "$hiboyscript2/scriptsh.txt" 31 | fi 32 | if [ ! -s /tmp/scriptsh.txt ] || [ -z "$(cat /tmp/scriptsh.txt | grep "sh_upscript")" ] || [ -z "$(cat /tmp/scriptsh.txt | grep "scriptt")" ] ; then 33 | /etc/storage/script/Sh01_mountopt.sh opt_cdn_force 34 | source /etc/storage/script/init.sh 35 | wgetcurl.sh "/tmp/scriptsh.txt" "$hiboyscript/scriptsh.txt" "$hiboyscript2/scriptsh.txt" 36 | fi 37 | if [ -s /tmp/scriptsh.txt ] && [ ! -z "$(cat /tmp/scriptsh.txt | grep "sh_upscript")" ] && [ ! -z "$(cat /tmp/scriptsh.txt | grep "scriptt")" ] ; then 38 | sed -Ei '/\ /d' /tmp/scriptsh.txt 39 | source /tmp/scriptsh.txt 40 | nvram set scriptt="$scriptt" 41 | nvram set scripto="2025-05-01" 42 | scriptt=`nvram get scriptt` 43 | scripto=`nvram get scripto` 44 | fi 45 | } 46 | 47 | file_check () { 48 | mkdir -p /tmp/script 49 | if [ -s /tmp/scriptsh.txt ] && [ ! -z "$(cat /tmp/scriptsh.txt | grep "sh_upscript")" ] && [ ! -z "$(cat /tmp/scriptsh.txt | grep "scriptt")" ] ; then 50 | while read line 51 | do 52 | c_line=`echo $line |grep -v "#" |grep -v 'scriptt='` 53 | file_name=${line%%=*} 54 | if [ ! -z "$c_line" ] && [ ! -z "$file_name" ] ; then 55 | MD5_TMP=`eval echo '$'${file_name}` 56 | MD5_ORI=`eval echo '$'$file_name"_o"` 57 | if [ ! -s /etc/storage/script/$file_name.sh ] || [ "$MD5_TMP"x != "$MD5_ORI"x ] ; then 58 | logger -t "【script】" "/etc/storage/script/$file_name.sh 脚本需要更新,自动下载!$hiboyscript/script/$file_name.sh" 59 | wgetcurl.sh "/tmp/script/$file_name.sh" "$hiboyscript/script/$file_name.sh" "$hiboyscript2/script/$file_name.sh" 60 | eval $(md5sum /tmp/script/$file_name.sh | awk '{print "MD5_ORI="$1;}') 61 | if [ -s /tmp/script/$file_name.sh ] && [ "$MD5_TMP"x = "$MD5_ORI"x ] ; then 62 | logger -t "【script】" " 更新【$file_name.sh】,md5匹配,更新成功!" 63 | mv -f /tmp/script/$file_name.sh /etc/storage/script/$file_name.sh 64 | if [ "$file_name"x = "initx" ] ; then 65 | /etc/storage/script/Sh01_mountopt.sh opt_force 66 | echo -n "" > /tmp/script/wgetcurl.sh 67 | source /etc/storage/script/init.sh 68 | fi 69 | else 70 | logger -t "【script】" "/tmp/script/$file_name.sh 脚本md5与记录不同,下载失败,跳过更新!" 71 | fi 72 | fi 73 | fi 74 | done < /tmp/scriptsh.txt 75 | fi 76 | } 77 | 78 | start_upscript () { 79 | [ "$upscript_enable" != "1" ] && return # 未启用自动更新 80 | logger -t "【script】" "脚本检查更新" 81 | file_t_check 82 | if [ -s /tmp/scriptsh.txt ] && [ ! -z "$(cat /tmp/scriptsh.txt | grep "sh_upscript")" ] && [ ! -z "$(cat /tmp/scriptsh.txt | grep "scriptt")" ] ; then 83 | [ "$scriptt"x = "$scripto"x ] && logger -t "【script】" "脚本已经最新" 84 | [ "$scriptt"x != "$scripto"x ] && [ "$upscript_enable" != "1" ] && logger -t "【script】" "当前【$scripto】脚本需要更新, 未启用自动更新, 请手动更新到【$scriptt】" && return 85 | if [ "$upscript_enable" = "1" ] && [ "$scriptt"x != "$scripto"x ] ; then 86 | logger -t "【script】" "脚本需要更新, 自动下载更新" 87 | nvram set scripto="$scriptt" 88 | file_o_check 89 | file_check 90 | logger -t "【script】" "脚本更新完成" 91 | fi 92 | else 93 | [ "$upscript_enable" != "1" ] && return 94 | logger -t "【script】" "脚本检查更新失败" 95 | fi 96 | } 97 | 98 | all_re_stop () { 99 | logger -t "【WebUI】" "UI 开关 stop" 100 | rm -f /tmp/webui_yes 101 | cp -f /etc/storage/script/sh_opt_script_check.sh /tmp/script/_opt_script_check 102 | killall menu_title.sh 103 | sync;echo 1 > /proc/sys/vm/drop_caches 104 | sleep 2 105 | } 106 | 107 | all_stop () { 108 | logger -t "【WebUI】" "UI 开关遍历 all_stop" 109 | rm -f /tmp/webui_yes 110 | chmod 777 /etc/storage/script -R 111 | killall menu_title.sh 112 | # start all services Sh??_* in /etc/storage/script 113 | for i in /etc/storage/script/Sh??_* ; do 114 | [ ! -x "${i}" ] && continue 115 | [ -f /tmp/webui_yes ] && continue 116 | eval ${i} stop 117 | done 118 | sync;echo 3 > /proc/sys/vm/drop_caches 119 | } 120 | 121 | all_check () { 122 | logger -t "【WebUI】" "UI 开关遍历 all_check" 123 | touch /tmp/webui_yes 124 | sync;echo 3 > /proc/sys/vm/drop_caches 125 | /etc/storage/crontabs_script.sh 126 | } 127 | 128 | all_up_web () { 129 | logger -t "【WebUI】" "遍历更新 web 页面" 130 | # 解压内置 asp 文件 131 | [ -s /etc_ro/www_asp.tgz ] && { tar -xzvf /etc_ro/www_asp.tgz -C /tmp ; chmod 666 /tmp/www_asp -R ; } 132 | chmod 777 /etc/storage/script -R 133 | # start all services Sh??_* in /etc/storage/script 134 | for i in /etc/storage/script/Sh??_* ; do 135 | [ ! -x "${i}" ] && continue 136 | eval ${i} update_asp 137 | done 138 | /etc/storage/www_sh/menu_title.sh 139 | sync;echo 3 > /proc/sys/vm/drop_caches 140 | } 141 | 142 | www_asp_re () { 143 | rm -f /tmp/www_asp_re 144 | logger -t "【WebUI】" "恢复内置 web 页面" 145 | # 解压内置 asp 文件 146 | [ -s /etc_ro/www_asp.tgz ] && { tar -xzvf /etc_ro/www_asp.tgz -C /tmp ; chmod 666 /tmp/www_asp -R ; } 147 | for i in `/usr/bin/find /tmp/www_asp/ -name 'Advanced*'` ; do 148 | [ -z "${i}" ] && continue 149 | i_2="$(/usr/bin/find /opt/app/ -name '*'"$(echo $(basename $i) | sed -e 's@asp$@@g')"'.asp')" 150 | [ -z "${i_2}" ] && continue 151 | cp -f "${i}" "${i_2}" 152 | rm -f "${i}" 153 | done 154 | sync;echo 3 > /proc/sys/vm/drop_caches 155 | } 156 | 157 | case $ACTION in 158 | all_check) 159 | all_check 160 | ;; 161 | all_stop) 162 | all_re_stop 163 | ;; 164 | all_re) 165 | all_stop 166 | all_check 167 | ;; 168 | stop) 169 | echo "stop" 170 | kill_ps "/etc/storage/script/sh_upscript.sh" 171 | kill_ps "sh_upscript.sh" 172 | kill_ps "$scriptname" 173 | ;; 174 | start) 175 | start_upscript 176 | ;; 177 | upweb) 178 | all_up_web 179 | ;; 180 | www_asp_re) 181 | www_asp_re 182 | ;; 183 | upscript) 184 | upscript_enable=1 185 | start_upscript 186 | ;; 187 | *) 188 | start_upscript 189 | ;; 190 | esac 191 | 192 | -------------------------------------------------------------------------------- /scriptsh.txt: -------------------------------------------------------------------------------- 1 | sh_ss_tproxy=6f60ee71b44a3096e6a8b899c1ce35e1 2 | sh_opt_script_check=cd57e861de0bf3705e36e39ac8500837 3 | sh_link=814f3e94d0f0cd8d2de538b709171a4e 4 | sh_ezscript=fe3053c064bddf747a89ef9afc5b1eff 5 | sh_emi=3959da42c9da709a04e23110422b01b9 6 | sh_0_script=ac5c6fc2d7463e4f2c1bc28b3d8f350e 7 | init=3aafe680302b832beeb4405b9d6360c5 8 | Sh99_ss_tproxy=5cb0ee65fa86fba5f7fa7911447024d1 9 | Sh93_zoraxy=2edca15d675732c5d4cbf5e822282aa3 10 | Sh92_arozos=ebf7aa40d8406b9e15e8764f024bb702 11 | Sh91_AdGuard_Home=6a91b0a6022b80f916f2b83938bf19f7 12 | Sh90_ddns_to=936ef7a97f2847449616fb0283294f9c 13 | Sh89_tailscale=7f6286ef0929b9395e1409278c3fba0f 14 | Sh88_ddns_go=aa12f111ff281ab24830b43f79f4bea3 15 | Sh87_cad_dy=9c0bd31f7e0d894d2b28a1c9c52e67e6 16 | Sh86_go_tify=f6e671d6aaa52c1fc39b023d231c0bed 17 | Sh85_mad_dy=8b85e97e58dffc97e12fff4e9a0672fd 18 | Sh84_v2raya=18a229fbb48fd7e81e417cc853844197 19 | Sh63_t_mall=de94c701c71b92fd91ae4cd4f414e519 20 | Sh62_shellina_box=ff2dd501ce216f886bcce626dfc8a27f 21 | Sh61_lnmp=12c7b6dfaf7da7d96dfa98ef5609c503 22 | Sh59_trans_late=eff23051287152bd11d95f41e6e695c5 23 | Sh58_tran_socks=61e483f43f24555f468f59f03556a0fd 24 | Sh57_virtual_here=a6dd2e2a53be99e01d2118da4e98345a 25 | Sh56_gofly_way=aadbf9e1ddb401b0a21920c5b21c09ce 26 | Sh55_very_sync=8ae78ffb6a7c2dd2f9c057ad8329cb6c 27 | Sh54_file_manager=e42ea5000d396c267d1fa784a74c14b2 28 | Sh53_you_ku=182e382e4046703447b6d4df5b238ed4 29 | Sh52_sync_thing=539a5f6c71ab56c5b64ce2ca7e694ae8 30 | Sh51_xun_lei=d28333b2e511d25e6992b4208d1767f5 31 | Sh50_tg_bot=6ac99aad7009698c76714f366ffa5a63 32 | Sh49_qcloud=9ff4c9cb97ecd5f67210986cdb6c46b9 33 | Sh48_Fast_Dick=a791646f0ba83b38b038afed9583e288 34 | Sh47_ssrserver=442d74f27630a1edd13c6a7300d7bc8a 35 | Sh46_display=757d750251825e864d33a7d19822da3c 36 | Sh45_wx_send=e60d88a37937dcbdf251911b86f37e42 37 | Sh45_server_chan=478a1017d0d451c0866d210615b5cc41 38 | Sh44_cloudflare=45c141da1c60647ed611b0e78a5c2cc7 39 | Sh43_huaweidns=7a7a81d8413fd46ffc40c24b4a0dd206 40 | Sh43_cloudxns=8ee9d8cf750090a6d645f97197381922 41 | Sh42_aliddns=3731d44233719e86d43a401a705c7be8 42 | Sh41_dnspod=673a37c283fb9038a656d9b0803894ed 43 | Sh40_dns_com_pod=aabff26b35ff9f4e8f360af27cc9c838 44 | Sh39_ipt2socks=7537725057166b68d8d4e365420b54ff 45 | Sh34_wifi_dog=0d6d6e0d3e97797eb5120ca7b369c71b 46 | Sh33_ngrok=09c9534694926576cb7674ff0be553eb 47 | Sh32_frp=eecf17dc724aa8ef72c423a5a60bd21d 48 | Sh31_orayd=4b89724dc74ed23561a41f6cec5f9c7d 49 | Sh30_np_s=ef6871c8b8dd90e5a3efcda8d967026c 50 | Sh28_guest_kit=5ac13fd02134eab8831fe05158593d6e 51 | Sh27_speedup=7e041301c34c5e46493054f2f13ad9ff 52 | Sh27_printer=11782c7635b179e2ca64b1915679e959 53 | Sh26_upd2pro=71608f1c163d778c70cb0afd4926656f 54 | Sh25_softether=6ec2f85fe315b75e0d5aae822a199aac 55 | Sh24_ssserver=c017e8562c4cb92a7dfa10d6f0f8b904 56 | Sh23_vpnproxy=0ef9ee8db1d63b8f442e0e46264211a3 57 | Sh22_tinyproxy=82aff87366373be59fb70afd4f469808 58 | Sh21_mproxy=79c624d9946a7d3c3cd53ae535c6ebb9 59 | Sh20_fakeincn=7d6fa3420534fd277b95f633ec09133d 60 | Sh19_chinadns=bbf0362361bf798d2ff50f1bd4ef3db2 61 | Sh18_v2ray=5be4772f91c37df9d29913a0ef4b7194 62 | Sh17_meow=658f645d1661af0d5ede74b86ba2ee19 63 | Sh16_cow=3e340b644838bd6065b074b82235d7c1 64 | Sh15_ss=2b1b2f28f3a72b7280353e1f938a75ed 65 | Sh14_kcp_tun=03a17904ff9f947490c6c9bea1154334 66 | Sh13_kool_proxy=f32c00f1147e63ca66eb0fdbc304ed10 67 | Sh12_ad_m=d832b2607776a26a70477c66b3e4e796 68 | Sh11_ad_byby=e5a93a729ced83094b0461cf46f49308 69 | Sh10_clash=1a134086d148282cf974facdc09d8abd 70 | Sh09_chinadns_ng=20c392fd15fa722acdf00ef76706a6f2 71 | Sh08_hysteria=00abc18504b647edd48ca7b1a6103807 72 | Sh05_go_cryptfs=50c70ae41b388636aae57df5adaefb9c 73 | Sh05_cry_fs=4d86baa32ed4f1a51c0a5e5a39a0d634 74 | Sh04_mento_hust=cc0cf04b1e20ce4f5e6d3d644896b721 75 | Sh03_jbls=76ab5d143c30e14051914a23fc9046a8 76 | Sh02_kms=84d2a502859e268cc41e6ef8ef4f0e2a 77 | Sh01_mountopt=3e80a3d7d3ae2083fe595bf4d9bb74eb 78 | sh_upscript=03f79d364adcc1697c874ab575ade3e4 79 | scriptt=2025-05-01 80 | -------------------------------------------------------------------------------- /up.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #copyright by hiboy 3 | #一键自动更新固件脚本 4 | #wget --no-check-certificate -O- https://opt.cn2qq.com/opt-script/up.sh | sed -e "s|^\(Firmware.*\)=[^=]*$|\1=|" > /tmp/up.sh && bash < /tmp/up.sh 5 | logger_echo () { 6 | logger -t "【Firmware】" "$1" 7 | echo "$(date "+%Y-%m-%d_%H-%M-%S") ""$1" 8 | } 9 | if [ -f /tmp/up_Firmware ] ; then 10 | logger_echo " 上次更新未完成,跳过更新!稍等几分钟可再次尝试更新!" 11 | exit 12 | fi 13 | touch /tmp/up_Firmware 14 | [ -f ~/.wget-hsts ] && chmod 644 ~/.wget-hsts 15 | export LD_LIBRARY_PATH=/lib:/opt/lib 16 | Firmware="$1" 17 | mkdir -p /tmp/padavan 18 | rm -f /tmp/padavan/* 19 | # 固件更新判断 20 | [ ! -f /tmp/ver_time ] && echo -n "0" > /tmp/ver_time 21 | if [ $(($(date "+1%m%d%H%M") - $(cat /tmp/ver_time))) -gt 1 ] ; then 22 | echo -n `nvram get firmver_sub` > /tmp/padavan/ver_osub 23 | rm -f /tmp/padavan/ver_nsub 24 | wget -O /tmp/padavan/ver_nsub https://opt.cn2qq.com/opt-file/osub 25 | if [ ! -s /tmp/padavan/ver_nsub ] ; then 26 | rm -f /tmp/padavan/ver_nsub 27 | wget --no-check-certificate -O /tmp/padavan/ver_nsub https://opt.cn2qq.com/opt-file/osub 28 | fi 29 | if [ -s /tmp/padavan/ver_osub ] && [ -s /tmp/padavan/ver_nsub ] && [ "$(cat /tmp/padavan/ver_osub |head -n1)"x == "$(cat /tmp/padavan/ver_nsub |head -n1)"x ] ; then 30 | logger_echo "新的固件:$(cat /tmp/padavan/ver_nsub | grep -v "^$")" 31 | logger_echo "目前固件:$(cat /tmp/padavan/ver_osub | grep -v "^$") " 32 | logger_echo "未有更新!如需再次刷入,请在一分钟内再次运行此命令进行强制更新" 33 | echo -n "$(date "+1%m%d%H%M")" > /tmp/ver_time 34 | echo "$(date "+1%m%d%H%M")" 35 | rm -f /tmp/up_Firmware; rm -f /tmp/padavan/* ; 36 | logger_echo "更新脚本" 37 | sh_upscript.sh upscript 38 | exit; 39 | else 40 | echo -n `nvram get firmver_sub` > /tmp/padavan/ver_osub 41 | logger_echo "新的固件:$(cat /tmp/padavan/ver_nsub | grep -v "^$") ,目前旧固件: $(cat /tmp/padavan/ver_osub | grep -v "^$") " 42 | logger_echo "更新固件:$(cat /tmp/padavan/ver_nsub | grep -v "^$") " 43 | fi 44 | else 45 | logger_echo "进行强制更新" 46 | fi 47 | # 固件 MD5 判断 48 | wget -O /tmp/padavan/MD5.txt https://opt.cn2qq.com/padavan/MD5.txt 49 | if [ ! -s /tmp/padavan/MD5.txt ] ; then 50 | rm -f /tmp/padavan/MD5.txt 51 | wget --no-check-certificate -O /tmp/padavan/MD5.txt https://opt.cn2qq.com/padavan/MD5.txt 52 | fi 53 | dos2unix /tmp/padavan/MD5.txt 54 | sed -e 's@\r@@g' -i /tmp/padavan/MD5.txt 55 | if [ "$Firmware"x != "x" ] ; then 56 | MD5_txt=`cat /tmp/padavan/MD5.txt | sed 's@\r@@g' |sed -n '/'$Firmware'/,/CRC32/{/'$Firmware'/n;/CRC32/b;p}' | grep "MD5:" | tr 'A-Z' 'a-z' |awk '{print $2}'` 57 | if [ "$MD5_txt"x = x ] ; then 58 | logger_echo " 未能获取【 $Firmware 】型号" 59 | Firmware="" 60 | fi 61 | fi 62 | if [ "$Firmware"x = "x" ] ; then 63 | PN=`grep Web_Title= /www/EN.dict | sed 's@\r@@g' | sed 's/Web_Title=//g'| sed 's/ 无线路由器\| Wireless Router//g'` 64 | [ "$PN"x != "x" ] && Firmware=`cat /tmp/padavan/MD5.txt | sed 's@\r@@g' | grep -Eo "$PN"'_.*' | sed -n '1p'` 65 | fi 66 | if [ "$Firmware"x = x ] ; then 67 | logger_echo " 未能获取【无线路由器】型号,跳过更新!可尝试手动指定型号更新! /tmp/up.sh newifi3D2_3.4.3.9-099.trx &" 68 | rm -f /tmp/up_Firmware; rm -f /tmp/padavan/* ; exit; 69 | fi 70 | MD5_txt=`cat /tmp/padavan/MD5.txt | sed 's@\r@@g' |sed -n '/'$Firmware'/,/CRC32/{/'$Firmware'/n;/CRC32/b;p}' | grep "MD5:" | tr 'A-Z' 'a-z' |awk '{print $2}'` 71 | if [ "$MD5_txt"x = x ] ; then 72 | logger_echo " 未能获取【 $Firmware 】型号 https://opt.cn2qq.com/padavan/MD5.txt 记录,跳过更新!稍后可再次尝试更新!" 73 | rm -f /tmp/up_Firmware; rm -f /tmp/padavan/* ; exit; 74 | fi 75 | # 调整 /tmp 剩余空间 76 | size_tmpfs=`nvram get size_tmpfs` 77 | [ -z "$size_tmpfs" ] && size_tmpfs="0" 78 | [ "$size_tmpfs" = "0" ] && mount -o remount,size=80% tmpfs /tmp 79 | rm -rf /tmp/xupnpd-cache 80 | rm -rf /tmp/xupnpd-feeds 81 | sync;echo 1 > /proc/sys/vm/drop_caches 82 | logger_echo " 下载【 $Firmware 】, https://opt.cn2qq.com/padavan/$Firmware" 83 | wget -O "/tmp/padavan/$Firmware" "https://opt.cn2qq.com/padavan/$Firmware" 84 | if [ ! -s "/tmp/padavan/$Firmware" ] ; then 85 | rm -f "/tmp/padavan/$Firmware" 86 | wget --no-check-certificate -O "/tmp/padavan/$Firmware" "https://opt.cn2qq.com/padavan/$Firmware" 87 | fi 88 | eval $(md5sum /tmp/padavan/$Firmware | awk '{print "MD5_down="$1;}') 89 | echo "$MD5_down" 90 | echo "$MD5_txt" 91 | # 固件刷入 92 | if [ -s "/tmp/padavan/$Firmware" ] && [ "$MD5_txt"x = "$MD5_down"x ] ; then 93 | logger_echo " 完成下载【$Firmware】,md5匹配,开始更新!请勿断电!" 94 | rm -f /tmp/padavan/log.txt 95 | mtd_write -r write "/tmp/padavan/$Firmware" Firmware_Stub > /tmp/padavan/log.txt 2>&1 & 96 | sleep 1 97 | while [ ! -f /tmp/padavan/log.txt ] ; do 98 | sleep 10 99 | logger_echo " 稍等【$Firmware】请勿断电!" 100 | done 101 | while [ -s /tmp/padavan/log.txt ] && [ ! -z "`pidof mtd_write`" ] ; do 102 | logger_echo " 稍等【$Firmware】正在更新!请勿断电!" 103 | sleep 10 104 | done 105 | mtd_log=`cat /tmp/padavan/log.txt | grep -Eo '\[ok\]'` 106 | if [ -s /tmp/padavan/log.txt ] && [ "$mtd_log"x = '[ok]x' ] ; then 107 | logger_echo " 更新【$Firmware】,[ok]!" 108 | logger_echo " 稍等【$Firmware】,自动重启!" 109 | logger_echo " 出现[ok]!为刷入成功,自动重启路由" 110 | sleep 2 111 | mtd_write -r unlock mtd1 112 | sleep 10 113 | reboot 114 | sleep 10 115 | mtd_write -r unlock mtd1 116 | sleep 10 117 | reboot 118 | logger_echo "如果自动重启失败可尝试手动重启路由" 119 | else 120 | logger_echo "`cat /tmp/padavan/log.txt`" 121 | logger_echo " 刷入出错【$Firmware】,更新失败!" 122 | fi 123 | else 124 | logger_echo " 下载【$Firmware】,md5与记录不同,下载失败,跳过更新!可重启后再次尝试更新!" 125 | logger_echo " 下载md5: $MD5_down" 126 | logger_echo " 记录md5: $MD5_txt" 127 | fi 128 | rm -f /tmp/up_Firmware; rm -f /tmp/padavan/* ; exit; 129 | 130 | -------------------------------------------------------------------------------- /www_sh/ADM: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_adm.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set adm_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set adm_L2="$(($3 + 10))" 15 | nvram set adm_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "adm_L2"); %>,<% nvram_get_x("", "adm_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/AdGuardHome: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app17.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_84=0 #AdGuardHome_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set AdGuardHome_L2="$(($3 + 10))" 16 | nvram set AdGuardHome_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "AdGuardHome_L2"); %>,<% nvram_get_x("", "AdGuardHome_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/AdGuardHome 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_AdGuardHomeasp" ] ; then 26 | if [ ! -f "/opt/app/AdGuardHome/Advanced_Extensions_AdGuardHome.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_AdGuardHomeasp /opt/app/AdGuardHome/Advanced_Extensions_AdGuardHome.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_AdGuardHomeasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/AdGuardHome/Advanced_Extensions_AdGuardHome.asp" ] || [ ! -s "/opt/app/AdGuardHome/Advanced_Extensions_AdGuardHome.asp" ] ; then 33 | wgetcurl.sh /opt/app/AdGuardHome/Advanced_Extensions_AdGuardHome.asp "$hiboyfile/Advanced_Extensions_AdGuardHomeasp" "$hiboyfile2/Advanced_Extensions_AdGuardHomeasp" 34 | fi 35 | umount /www/Advanced_Extensions_app17.asp 36 | if [ -f "/opt/app/AdGuardHome/Advanced_Extensions_AdGuardHome.asp" ] ; then 37 | mount --bind /opt/app/AdGuardHome/Advanced_Extensions_AdGuardHome.asp /www/Advanced_Extensions_app17.asp 38 | app17_ver=$(grep 'app17_ver=' /opt/app/AdGuardHome/Advanced_Extensions_AdGuardHome.asp | awk -F '=' '{print $2;}') 39 | nvram set app17_ver=${app17_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh91_AdGuard_Home.sh 49 | if [ ! -f "/etc/storage/script/Sh91_AdGuard_Home.sh" ] || [ ! -s "/etc/storage/script/Sh91_AdGuard_Home.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh91_AdGuard_Home.sh "$hiboyscript/script/Sh91_AdGuard_Home.sh" "$hiboyscript/script/Sh91_AdGuard_Home.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_19.sh" ] || [ ! -s "/etc/storage/app_19.sh" ] ; then 54 | /etc/storage/script/Sh91_AdGuard_Home.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/Adbyby: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_adbyby.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set adbyby_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set adbyby_L2="$(($3 + 10))" 15 | nvram set adbyby_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "adbyby_L2"); %>,<% nvram_get_x("", "adbyby_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/Aliddns: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_aliddns.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set aliddns_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set aliddns_L2="$(($3 + 10))" 15 | nvram set aliddns_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "aliddns_L2"); %>,<% nvram_get_x("", "aliddns_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/ArozOS: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app30.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_148=0 #arozos_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set arozos_L2="$(($3 + 10))" 16 | nvram set arozos_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "arozos_L2"); %>,<% nvram_get_x("", "arozos_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/arozos 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_arozosasp" ] ; then 26 | if [ ! -f "/opt/app/arozos/Advanced_Extensions_arozos.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_arozosasp /opt/app/arozos/Advanced_Extensions_arozos.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_arozosasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/arozos/Advanced_Extensions_arozos.asp" ] || [ ! -s "/opt/app/arozos/Advanced_Extensions_arozos.asp" ] ; then 33 | wgetcurl.sh /opt/app/arozos/Advanced_Extensions_arozos.asp "$hiboyfile/Advanced_Extensions_arozosasp" "$hiboyfile2/Advanced_Extensions_arozosasp" 34 | fi 35 | umount /www/Advanced_Extensions_app30.asp 36 | if [ -f "/opt/app/arozos/Advanced_Extensions_arozos.asp" ] ; then 37 | mount --bind /opt/app/arozos/Advanced_Extensions_arozos.asp /www/Advanced_Extensions_app30.asp 38 | app30_ver=$(grep 'app30_ver=' /opt/app/arozos/Advanced_Extensions_arozos.asp | awk -F '=' '{print $2;}') 39 | nvram set app30_ver=${app30_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh92_arozos.sh 49 | if [ ! -f "/etc/storage/script/Sh92_arozos.sh" ] || [ ! -s "/etc/storage/script/Sh92_arozos.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh92_arozos.sh "$hiboyscript/script/Sh92_arozos.sh" "$hiboyscript/script/Sh92_arozos.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | 54 | [ "$1" = "del" ] && exit 55 | 56 | } 57 | 58 | if [ -f /tmp/webui_yes ] ; then 59 | get_www & 60 | get_app $1 & 61 | [ "$1" = "del" ] && exit 62 | fi 63 | 64 | -------------------------------------------------------------------------------- /www_sh/COW: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_COW.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set cow_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set cow_L2="$(($3 + 10))" 15 | nvram set cow_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "cow_L2"); %>,<% nvram_get_x("", "cow_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/CloudXNS: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "www_CloudXNS" -------------------------------------------------------------------------------- /www_sh/DNSPod: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_DNSPod.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set dnspod_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set dnspod_L2="$(($3 + 10))" 15 | nvram set dnspod_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "dnspod_L2"); %>,<% nvram_get_x("", "dnspod_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/Kcptun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_SS_Kcptun.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set kcptun_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set kcptun_L2="$(($3 + 10))" 15 | nvram set kcptun_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "kcptun_L2"); %>,<% nvram_get_x("", "kcptun_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/MEOW: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_MEOW.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set meow_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set meow_L2="$(($3 + 10))" 15 | nvram set meow_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "meow_L2"); %>,<% nvram_get_x("", "meow_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/Ngrok: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_ngrok.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set ngrok_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set ngrok_L2="$(($3 + 10))" 15 | nvram set ngrok_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "ngrok_L2"); %>,<% nvram_get_x("", "ngrok_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/SSR_Server: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "SSR_Server" 5 | -------------------------------------------------------------------------------- /www_sh/SS_Server: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_SS_Server.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set ssserver_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set ssserver_L2="$(($3 + 10))" 15 | nvram set ssserver_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "ssserver_L2"); %>,<% nvram_get_x("", "ssserver_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/SS节点: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_SS_list.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | #nvram set SS_list=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set SS_list_L2="$(($3 + 10))" 15 | nvram set SS_list_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "SS_list_L2"); %>,<% nvram_get_x("", "SS_list_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/SS配置: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_SS.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set ss_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set ss_L2="$(($3 + 10))" 15 | nvram set ss_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "ss_L2"); %>,<% nvram_get_x("", "ss_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/SoftEtherVPN: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_softether.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set softether_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set softether_L2="$(($3 + 10))" 15 | nvram set softether_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "softether_L2"); %>,<% nvram_get_x("", "softether_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/Wifidog: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_wifidog.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set wifidog_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set wifidog_L2="$(($3 + 10))" 15 | nvram set wifidog_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "wifidog_L2"); %>,<% nvram_get_x("", "wifidog_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/Zoraxy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app31.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_149=0 #zoraxy_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set zoraxy_L2="$(($3 + 10))" 16 | nvram set zoraxy_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "zoraxy_L2"); %>,<% nvram_get_x("", "zoraxy_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/zoraxy 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_zoraxyasp" ] ; then 26 | if [ ! -f "/opt/app/zoraxy/Advanced_Extensions_zoraxy.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_zoraxyasp /opt/app/zoraxy/Advanced_Extensions_zoraxy.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_zoraxyasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/zoraxy/Advanced_Extensions_zoraxy.asp" ] || [ ! -s "/opt/app/zoraxy/Advanced_Extensions_zoraxy.asp" ] ; then 33 | wgetcurl.sh /opt/app/zoraxy/Advanced_Extensions_zoraxy.asp "$hiboyfile/Advanced_Extensions_zoraxyasp" "$hiboyfile2/Advanced_Extensions_zoraxyasp" 34 | fi 35 | umount /www/Advanced_Extensions_app31.asp 36 | if [ -f "/opt/app/zoraxy/Advanced_Extensions_zoraxy.asp" ] ; then 37 | mount --bind /opt/app/zoraxy/Advanced_Extensions_zoraxy.asp /www/Advanced_Extensions_app31.asp 38 | app31_ver=$(grep 'app31_ver=' /opt/app/zoraxy/Advanced_Extensions_zoraxy.asp | awk -F '=' '{print $2;}') 39 | nvram set app31_ver=${app31_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh93_zoraxy.sh 49 | if [ ! -f "/etc/storage/script/Sh93_zoraxy.sh" ] || [ ! -s "/etc/storage/script/Sh93_zoraxy.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh93_zoraxy.sh "$hiboyscript/script/Sh93_zoraxy.sh" "$hiboyscript/script/Sh93_zoraxy.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | 54 | [ "$1" = "del" ] && exit 55 | 56 | } 57 | 58 | if [ -f /tmp/webui_yes ] ; then 59 | get_www & 60 | get_app $1 & 61 | [ "$1" = "del" ] && exit 62 | fi 63 | 64 | -------------------------------------------------------------------------------- /www_sh/caddy: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app26.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_139=0 #caddy_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set caddy_L2="$(($3 + 10))" 16 | nvram set caddy_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "caddy_L2"); %>,<% nvram_get_x("", "caddy_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/caddy 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_caddyasp" ] ; then 26 | if [ ! -f "/opt/app/caddy/Advanced_Extensions_caddy.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_caddyasp /opt/app/caddy/Advanced_Extensions_caddy.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_caddyasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/caddy/Advanced_Extensions_caddy.asp" ] || [ ! -s "/opt/app/caddy/Advanced_Extensions_caddy.asp" ] ; then 33 | wgetcurl.sh /opt/app/caddy/Advanced_Extensions_caddy.asp "$hiboyfile/Advanced_Extensions_caddyasp" "$hiboyfile2/Advanced_Extensions_caddyasp" 34 | fi 35 | umount /www/Advanced_Extensions_app26.asp 36 | if [ -f "/opt/app/caddy/Advanced_Extensions_caddy.asp" ] ; then 37 | mount --bind /opt/app/caddy/Advanced_Extensions_caddy.asp /www/Advanced_Extensions_app26.asp 38 | app26_ver=$(grep 'app26_ver=' /opt/app/caddy/Advanced_Extensions_caddy.asp | awk -F '=' '{print $2;}') 39 | nvram set app26_ver=${app26_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh87_cad_dy.sh 49 | if [ ! -f "/etc/storage/script/Sh87_cad_dy.sh" ] || [ ! -s "/etc/storage/script/Sh87_cad_dy.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh87_cad_dy.sh "$hiboyscript/script/Sh87_cad_dy.sh" "$hiboyscript/script/Sh87_cad_dy.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_11.sh" ] || [ ! -s "/etc/storage/app_11.sh" ] ; then 54 | /etc/storage/script/Sh87_cad_dy.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/chinadns: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 失效清理 3 | echo "chinadns" 4 | 5 | -------------------------------------------------------------------------------- /www_sh/chinadns_ng: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app19.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_102=0 #chinadns_ng_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set chinadns_ng_L2="$(($3 + 10))" 16 | nvram set chinadns_ng_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "chinadns_ng_L2"); %>,<% nvram_get_x("", "chinadns_ng_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/chinadns_ng 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_chinadns_ngasp" ] ; then 26 | if [ ! -f "/opt/app/chinadns_ng/Advanced_Extensions_chinadns_ng.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_chinadns_ngasp /opt/app/chinadns_ng/Advanced_Extensions_chinadns_ng.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_chinadns_ngasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/chinadns_ng/Advanced_Extensions_chinadns_ng.asp" ] || [ ! -s "/opt/app/chinadns_ng/Advanced_Extensions_chinadns_ng.asp" ] ; then 33 | wgetcurl.sh /opt/app/chinadns_ng/Advanced_Extensions_chinadns_ng.asp "$hiboyfile/Advanced_Extensions_chinadns_ngasp" "$hiboyfile2/Advanced_Extensions_chinadns_ngasp" 34 | fi 35 | umount /www/Advanced_Extensions_app19.asp 36 | if [ -f "/opt/app/chinadns_ng/Advanced_Extensions_chinadns_ng.asp" ] ; then 37 | mount --bind /opt/app/chinadns_ng/Advanced_Extensions_chinadns_ng.asp /www/Advanced_Extensions_app19.asp 38 | app19_ver=$(grep 'app19_ver=' /opt/app/chinadns_ng/Advanced_Extensions_chinadns_ng.asp | awk -F '=' '{print $2;}') 39 | nvram set app19_ver=${app19_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh09_chinadns_ng.sh 49 | if [ ! -f "/etc/storage/script/Sh09_chinadns_ng.sh" ] || [ ! -s "/etc/storage/script/Sh09_chinadns_ng.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh09_chinadns_ng.sh "$hiboyscript/script/Sh09_chinadns_ng.sh" "$hiboyscript/script/Sh09_chinadns_ng.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | [ "$1" = "del" ] && exit 54 | 55 | } 56 | 57 | if [ -f /tmp/webui_yes ] ; then 58 | get_www & 59 | get_app $1 & 60 | [ "$1" = "del" ] && exit 61 | fi 62 | 63 | 64 | -------------------------------------------------------------------------------- /www_sh/clash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app18.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_88=0 #clash_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set clash_L2="$(($3 + 10))" 16 | nvram set clash_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "clash_L2"); %>,<% nvram_get_x("", "clash_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/clash 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_clashasp" ] ; then 26 | if [ ! -f "/opt/app/clash/Advanced_Extensions_clash.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_clashasp /opt/app/clash/Advanced_Extensions_clash.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_clashasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/clash/Advanced_Extensions_clash.asp" ] || [ ! -s "/opt/app/clash/Advanced_Extensions_clash.asp" ] ; then 33 | wgetcurl.sh /opt/app/clash/Advanced_Extensions_clash.asp "$hiboyfile/Advanced_Extensions_clashasp" "$hiboyfile2/Advanced_Extensions_clashasp" 34 | fi 35 | umount /www/Advanced_Extensions_app18.asp 36 | if [ -f "/opt/app/clash/Advanced_Extensions_clash.asp" ] ; then 37 | mount --bind /opt/app/clash/Advanced_Extensions_clash.asp /www/Advanced_Extensions_app18.asp 38 | app18_ver=$(grep 'app18_ver=' /opt/app/clash/Advanced_Extensions_clash.asp | awk -F '=' '{print $2;}') 39 | nvram set app18_ver=${app18_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh10_clash.sh 49 | if [ ! -f "/etc/storage/script/Sh10_clash.sh" ] || [ ! -s "/etc/storage/script/Sh10_clash.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh10_clash.sh "$hiboyscript/script/Sh10_clash.sh" "$hiboyscript/script/Sh10_clash.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_20.sh" ] || [ ! -s "/etc/storage/app_20.sh" ] ; then 54 | /etc/storage/script/Sh10_clash.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/cloudflare: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_cloudflare.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set cloudflare_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set cloudflare_L2="$(($3 + 10))" 15 | nvram set cloudflare_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "cloudflare_L2"); %>,<% nvram_get_x("", "cloudflare_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/cryfs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app15.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_61=0 #cryfs_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set cryfs_L2="$(($3 + 10))" 16 | nvram set cryfs_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "cryfs_L2"); %>,<% nvram_get_x("", "cryfs_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/cryfs 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_cryfsasp" ] ; then 26 | if [ ! -f "/opt/app/cryfs/Advanced_Extensions_cryfs.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_cryfsasp /opt/app/cryfs/Advanced_Extensions_cryfs.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_cryfsasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/cryfs/Advanced_Extensions_cryfs.asp" ] || [ ! -s "/opt/app/cryfs/Advanced_Extensions_cryfs.asp" ] ; then 33 | wgetcurl.sh /opt/app/cryfs/Advanced_Extensions_cryfs.asp "$hiboyfile/Advanced_Extensions_cryfsasp" "$hiboyfile2/Advanced_Extensions_cryfsasp" 34 | fi 35 | umount /www/Advanced_Extensions_app15.asp 36 | if [ -f "/opt/app/cryfs/Advanced_Extensions_cryfs.asp" ] ; then 37 | mount --bind /opt/app/cryfs/Advanced_Extensions_cryfs.asp /www/Advanced_Extensions_app15.asp 38 | app15_ver=$(grep 'app15_ver=' /opt/app/cryfs/Advanced_Extensions_cryfs.asp | awk -F '=' '{print $2;}') 39 | nvram set app15_ver=${app15_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh05_cry_fs.sh 49 | if [ ! -f "/etc/storage/script/Sh05_cry_fs.sh" ] || [ ! -s "/etc/storage/script/Sh05_cry_fs.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh05_cry_fs.sh "$hiboyscript/script/Sh05_cry_fs.sh" "$hiboyscript/script/Sh05_cry_fs.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_17.sh" ] || [ ! -s "/etc/storage/app_17.sh" ] || [ ! -f "/etc/storage/app_18.sh" ] || [ ! -s "/etc/storage/app_18.sh" ] ; then 54 | /etc/storage/script/Sh05_cry_fs.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/ddnsgo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app25.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_45=0 #ddnsgo_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set ddnsgo_L2="$(($3 + 10))" 16 | nvram set ddnsgo_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "ddnsgo_L2"); %>,<% nvram_get_x("", "ddnsgo_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/ddnsgo 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_ddnsgoasp" ] ; then 26 | if [ ! -f "/opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_ddnsgoasp /opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_ddnsgoasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp" ] || [ ! -s "/opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp" ] ; then 33 | wgetcurl.sh /opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp "$hiboyfile/Advanced_Extensions_ddnsgoasp" "$hiboyfile2/Advanced_Extensions_ddnsgoasp" 34 | fi 35 | umount /www/Advanced_Extensions_app25.asp 36 | if [ -f "/opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp" ] ; then 37 | mount --bind /opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp /www/Advanced_Extensions_app25.asp 38 | app25_ver=$(grep 'app25_ver=' /opt/app/ddnsgo/Advanced_Extensions_ddnsgo.asp | awk -F '=' '{print $2;}') 39 | nvram set app25_ver=${app25_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh88_ddns_go.sh 49 | if [ ! -f "/etc/storage/script/Sh88_ddns_go.sh" ] || [ ! -s "/etc/storage/script/Sh88_ddns_go.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh88_ddns_go.sh "$hiboyscript/script/Sh88_ddns_go.sh" "$hiboyscript/script/Sh88_ddns_go.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_35.sh" ] || [ ! -s "/etc/storage/app_35.sh" ] ; then 54 | /etc/storage/script/Sh88_ddns_go.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/ddnsto: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app16.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_64=0 #ddnsto_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set ddnsto_L2="$(($3 + 10))" 16 | nvram set ddnsto_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "ddnsto_L2"); %>,<% nvram_get_x("", "ddnsto_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/ddnsto 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_ddnstoasp" ] ; then 26 | if [ ! -f "/opt/app/ddnsto/Advanced_Extensions_ddnsto.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_ddnstoasp /opt/app/ddnsto/Advanced_Extensions_ddnsto.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_ddnstoasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/ddnsto/Advanced_Extensions_ddnsto.asp" ] || [ ! -s "/opt/app/ddnsto/Advanced_Extensions_ddnsto.asp" ] ; then 33 | wgetcurl.sh /opt/app/ddnsto/Advanced_Extensions_ddnsto.asp "$hiboyfile/Advanced_Extensions_ddnstoasp" "$hiboyfile2/Advanced_Extensions_ddnstoasp" 34 | fi 35 | umount /www/Advanced_Extensions_app16.asp 36 | if [ -f "/opt/app/ddnsto/Advanced_Extensions_ddnsto.asp" ] ; then 37 | mount --bind /opt/app/ddnsto/Advanced_Extensions_ddnsto.asp /www/Advanced_Extensions_app16.asp 38 | app16_ver=$(grep 'app16_ver=' /opt/app/ddnsto/Advanced_Extensions_ddnsto.asp | awk -F '=' '{print $2;}') 39 | nvram set app16_ver=${app16_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh90_ddns_to.sh 49 | if [ ! -f "/etc/storage/script/Sh90_ddns_to.sh" ] || [ ! -s "/etc/storage/script/Sh90_ddns_to.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh90_ddns_to.sh "$hiboyscript/script/Sh90_ddns_to.sh" "$hiboyscript/script/Sh90_ddns_to.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | 54 | [ "$1" = "del" ] && exit 55 | 56 | } 57 | 58 | if [ -f /tmp/webui_yes ] ; then 59 | get_www & 60 | get_app $1 & 61 | [ "$1" = "del" ] && exit 62 | fi 63 | 64 | -------------------------------------------------------------------------------- /www_sh/filemanager: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app05.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_15=0 #filemanager_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set filemanager_L2="$(($3 + 10))" 16 | nvram set filemanager_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "filemanager_L2"); %>,<% nvram_get_x("", "filemanager_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/filemanager 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_filemanagerasp" ] ; then 26 | if [ ! -f "/opt/app/filemanager/Advanced_Extensions_filemanager.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_filemanagerasp /opt/app/filemanager/Advanced_Extensions_filemanager.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_filemanagerasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/filemanager/Advanced_Extensions_filemanager.asp" ] || [ ! -s "/opt/app/filemanager/Advanced_Extensions_filemanager.asp" ] ; then 33 | wgetcurl.sh /opt/app/filemanager/Advanced_Extensions_filemanager.asp "$hiboyfile/Advanced_Extensions_filemanagerasp" "$hiboyfile2/Advanced_Extensions_filemanagerasp" 34 | fi 35 | umount /www/Advanced_Extensions_app05.asp 36 | if [ -f "/opt/app/filemanager/Advanced_Extensions_filemanager.asp" ] ; then 37 | mount --bind /opt/app/filemanager/Advanced_Extensions_filemanager.asp /www/Advanced_Extensions_app05.asp 38 | app5_ver=$(grep 'app5_ver=' /opt/app/filemanager/Advanced_Extensions_filemanager.asp | awk -F '=' '{print $2;}') 39 | nvram set app5_ver=${app5_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh54_file_manager.sh 49 | if [ ! -f "/etc/storage/script/Sh54_file_manager.sh" ] || [ ! -s "/etc/storage/script/Sh54_file_manager.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh54_file_manager.sh "$hiboyscript/script/Sh54_file_manager.sh" "$hiboyscript/script/Sh54_file_manager.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | # 初始配置脚本 54 | if [ ! -f "/etc/storage/app_5.sh" ] || [ ! -s "/etc/storage/app_5.sh" ] ; then 55 | /etc/storage/script/Sh54_file_manager.sh update_app 56 | fi 57 | 58 | [ "$1" = "del" ] && exit 59 | 60 | } 61 | 62 | if [ -f /tmp/webui_yes ] ; then 63 | get_www & 64 | get_app $1 & 65 | [ "$1" = "del" ] && exit 66 | fi 67 | 68 | -------------------------------------------------------------------------------- /www_sh/frp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_frp.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set frp_enable=0 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set frp_L2="$(($3 + 10))" 16 | nvram set frp_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "frp_L2"); %>,<% nvram_get_x("", "frp_L3"); %>); 18 | fi 19 | 20 | get_app () 21 | { 22 | 23 | # 更新程序启动脚本 24 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh32_frp.sh 25 | if [ ! -f "/etc/storage/script/Sh32_frp.sh" ] || [ ! -s "/etc/storage/script/Sh32_frp.sh" ] ; then 26 | wgetcurl.sh /etc/storage/script/Sh32_frp.sh "$hiboyscript/script/Sh32_frp.sh" "$hiboyscript/script/Sh32_frp.sh" 27 | fi 28 | chmod 777 /etc/storage/script -R 29 | if [ ! -f "/etc/storage/frp_script.sh" ] || [ ! -s "/etc/storage/frp_script.sh" ] ; then 30 | /etc/storage/script/Sh32_frp.sh update_app 31 | fi 32 | 33 | [ "$1" = "del" ] && exit 34 | 35 | } 36 | 37 | if [ -f /tmp/webui_yes ] ; then 38 | get_app $1 & 39 | [ "$1" = "del" ] && exit 40 | fi 41 | -------------------------------------------------------------------------------- /www_sh/gocryptfs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app23.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_133=0 #gocryptfs_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set gocryptfs_L2="$(($3 + 10))" 16 | nvram set gocryptfs_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "gocryptfs_L2"); %>,<% nvram_get_x("", "gocryptfs_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/gocryptfs 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_gocryptfsasp" ] ; then 26 | if [ ! -f "/opt/app/gocryptfs/Advanced_Extensions_gocryptfs.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_gocryptfsasp /opt/app/gocryptfs/Advanced_Extensions_gocryptfs.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_gocryptfsasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/gocryptfs/Advanced_Extensions_gocryptfs.asp" ] || [ ! -s "/opt/app/gocryptfs/Advanced_Extensions_gocryptfs.asp" ] ; then 33 | wgetcurl.sh /opt/app/gocryptfs/Advanced_Extensions_gocryptfs.asp "$hiboyfile/Advanced_Extensions_gocryptfsasp" "$hiboyfile2/Advanced_Extensions_gocryptfsasp" 34 | fi 35 | umount /www/Advanced_Extensions_app23.asp 36 | if [ -f "/opt/app/gocryptfs/Advanced_Extensions_gocryptfs.asp" ] ; then 37 | mount --bind /opt/app/gocryptfs/Advanced_Extensions_gocryptfs.asp /www/Advanced_Extensions_app23.asp 38 | app23_ver=$(grep 'app23_ver=' /opt/app/gocryptfs/Advanced_Extensions_gocryptfs.asp | awk -F '=' '{print $2;}') 39 | nvram set app23_ver=${app23_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh05_go_cryptfs.sh 49 | if [ ! -f "/etc/storage/script/Sh05_go_cryptfs.sh" ] || [ ! -s "/etc/storage/script/Sh05_go_cryptfs.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh05_go_cryptfs.sh "$hiboyscript/script/Sh05_go_cryptfs.sh" "$hiboyscript/script/Sh05_go_cryptfs.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_17.sh" ] || [ ! -s "/etc/storage/app_17.sh" ] || [ ! -f "/etc/storage/app_32.sh" ] || [ ! -s "/etc/storage/app_32.sh" ] ; then 54 | /etc/storage/script/Sh05_go_cryptfs.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/goflyway: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app07.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_23=0 #goflyway_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set goflyway_L2="$(($3 + 10))" 16 | nvram set goflyway_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "goflyway_L2"); %>,<% nvram_get_x("", "goflyway_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/goflyway 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_goflywayasp" ] ; then 26 | if [ ! -f "/opt/app/goflyway/Advanced_Extensions_goflyway.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_goflywayasp /opt/app/goflyway/Advanced_Extensions_goflyway.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_goflywayasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/goflyway/Advanced_Extensions_goflyway.asp" ] || [ ! -s "/opt/app/goflyway/Advanced_Extensions_goflyway.asp" ] ; then 33 | wgetcurl.sh /opt/app/goflyway/Advanced_Extensions_goflyway.asp "$hiboyfile/Advanced_Extensions_goflywayasp" "$hiboyfile2/Advanced_Extensions_goflywayasp" 34 | fi 35 | umount /www/Advanced_Extensions_app07.asp 36 | if [ -f "/opt/app/goflyway/Advanced_Extensions_goflyway.asp" ] ; then 37 | mount --bind /opt/app/goflyway/Advanced_Extensions_goflyway.asp /www/Advanced_Extensions_app07.asp 38 | app7_ver=$(grep 'app7_ver=' /opt/app/goflyway/Advanced_Extensions_goflyway.asp | awk -F '=' '{print $2;}') 39 | nvram set app7_ver=${app7_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh56_gofly_way.sh /etc/storage/app_7.sh 49 | if [ ! -f "/etc/storage/script/Sh56_gofly_way.sh" ] || [ ! -s "/etc/storage/script/Sh56_gofly_way.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh56_gofly_way.sh "$hiboyscript/script/Sh56_gofly_way.sh" "$hiboyscript/script/Sh56_gofly_way.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_7.sh" ] || [ ! -s "/etc/storage/app_7.sh" ] ; then 54 | /etc/storage/script/Sh56_gofly_way.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/gotify推送: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app27.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_140=0 #gotify_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set gotify_L2="$(($3 + 10))" 16 | nvram set gotify_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "gotify_L2"); %>,<% nvram_get_x("", "gotify_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/gotify 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_gotifyasp" ] ; then 26 | if [ ! -f "/opt/app/gotify/Advanced_Extensions_gotify.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_gotifyasp /opt/app/gotify/Advanced_Extensions_gotify.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_gotifyasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/gotify/Advanced_Extensions_gotify.asp" ] || [ ! -s "/opt/app/gotify/Advanced_Extensions_gotify.asp" ] ; then 33 | wgetcurl.sh /opt/app/gotify/Advanced_Extensions_gotify.asp "$hiboyfile/Advanced_Extensions_gotifyasp" "$hiboyfile2/Advanced_Extensions_gotifyasp" 34 | fi 35 | umount /www/Advanced_Extensions_app27.asp 36 | if [ -f "/opt/app/gotify/Advanced_Extensions_gotify.asp" ] ; then 37 | mount --bind /opt/app/gotify/Advanced_Extensions_gotify.asp /www/Advanced_Extensions_app27.asp 38 | app27_ver=$(grep 'app27_ver=' /opt/app/gotify/Advanced_Extensions_gotify.asp | awk -F '=' '{print $2;}') 39 | nvram set app27_ver=${app27_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh86_go_tify.sh 49 | if [ ! -f "/etc/storage/script/Sh86_go_tify.sh" ] || [ ! -s "/etc/storage/script/Sh86_go_tify.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh86_go_tify.sh "$hiboyscript/script/Sh86_go_tify.sh" "$hiboyscript/script/Sh86_go_tify.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_36.sh" ] || [ ! -s "/etc/storage/app_36.sh" ] ; then 54 | /etc/storage/script/Sh86_go_tify.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/guestkit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app09.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_26=0 #guestkit_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set guestkit_L2="$(($3 + 10))" 16 | nvram set guestkit_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "guestkit_L2"); %>,<% nvram_get_x("", "guestkit_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/guestkit 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_guestkitasp" ] ; then 26 | if [ ! -f "/opt/app/guestkit/Advanced_Extensions_guestkit.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_guestkitasp /opt/app/guestkit/Advanced_Extensions_guestkit.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_guestkitasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/guestkit/Advanced_Extensions_guestkit.asp" ] || [ ! -s "/opt/app/guestkit/Advanced_Extensions_guestkit.asp" ] ; then 33 | wgetcurl.sh /opt/app/guestkit/Advanced_Extensions_guestkit.asp "$hiboyfile/Advanced_Extensions_guestkitasp" "$hiboyfile2/Advanced_Extensions_guestkitasp" 34 | fi 35 | umount /www/Advanced_Extensions_app09.asp 36 | if [ -f "/opt/app/guestkit/Advanced_Extensions_guestkit.asp" ] ; then 37 | mount --bind /opt/app/guestkit/Advanced_Extensions_guestkit.asp /www/Advanced_Extensions_app09.asp 38 | app9_ver=$(grep 'app9_ver=' /opt/app/guestkit/Advanced_Extensions_guestkit.asp | awk -F '=' '{print $2;}') 39 | nvram set app9_ver=${app9_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh28_guest_kit.sh 49 | if [ ! -f "/etc/storage/script/Sh28_guest_kit.sh" ] || [ ! -s "/etc/storage/script/Sh28_guest_kit.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh28_guest_kit.sh "$hiboyscript/script/Sh28_guest_kit.sh" "$hiboyscript/script/Sh28_guest_kit.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | # if [ ! -f "/etc/storage/app_8.sh" ] || [ ! -s "/etc/storage/app_8.sh" ] ; then 54 | # /etc/storage/script/Sh28_guest_kit.sh update_app 55 | # fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/huaweidns: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_huaweidns.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set huaweidns_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set huaweidns_L2="$(($3 + 10))" 15 | nvram set huaweidns_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "huaweidns_L2"); %>,<% nvram_get_x("", "huaweidns_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/hysteria: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app24.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_136=0 #hysteria_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set hysteria_L2="$(($3 + 10))" 16 | nvram set hysteria_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "hysteria_L2"); %>,<% nvram_get_x("", "hysteria_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/hysteria 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_hysteriaasp" ] ; then 26 | if [ ! -f "/opt/app/hysteria/Advanced_Extensions_hysteria.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_hysteriaasp /opt/app/hysteria/Advanced_Extensions_hysteria.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_hysteriaasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/hysteria/Advanced_Extensions_hysteria.asp" ] || [ ! -s "/opt/app/hysteria/Advanced_Extensions_hysteria.asp" ] ; then 33 | wgetcurl.sh /opt/app/hysteria/Advanced_Extensions_hysteria.asp "$hiboyfile/Advanced_Extensions_hysteriaasp" "$hiboyfile2/Advanced_Extensions_hysteriaasp" 34 | fi 35 | umount /www/Advanced_Extensions_app24.asp 36 | if [ -f "/opt/app/hysteria/Advanced_Extensions_hysteria.asp" ] ; then 37 | mount --bind /opt/app/hysteria/Advanced_Extensions_hysteria.asp /www/Advanced_Extensions_app24.asp 38 | app24_ver=$(grep 'app24_ver=' /opt/app/hysteria/Advanced_Extensions_hysteria.asp | awk -F '=' '{print $2;}') 39 | nvram set app24_ver=${app24_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh08_hysteria.sh 49 | if [ ! -f "/etc/storage/script/Sh08_hysteria.sh" ] || [ ! -s "/etc/storage/script/Sh08_hysteria.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh08_hysteria.sh "$hiboyscript/script/Sh08_hysteria.sh" "$hiboyscript/script/Sh08_hysteria.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_34.sh" ] || [ ! -s "/etc/storage/app_34.sh" ] ; then 54 | /etc/storage/script/Sh08_hysteria.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/ipt2socks: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app20.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_104=0 #ipt2socks_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set ipt2socks_L2="$(($3 + 10))" 16 | nvram set ipt2socks_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "ipt2socks_L2"); %>,<% nvram_get_x("", "ipt2socks_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/ipt2socks 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_ipt2socksasp" ] ; then 26 | if [ ! -f "/opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_ipt2socksasp /opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_ipt2socksasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp" ] || [ ! -s "/opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp" ] ; then 33 | wgetcurl.sh /opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp "$hiboyfile/Advanced_Extensions_ipt2socksasp" "$hiboyfile2/Advanced_Extensions_ipt2socksasp" 34 | fi 35 | umount /www/Advanced_Extensions_app20.asp 36 | if [ -f "/opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp" ] ; then 37 | mount --bind /opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp /www/Advanced_Extensions_app20.asp 38 | app20_ver=$(grep 'app20_ver=' /opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp | awk -F '=' '{print $2;}') 39 | nvram set app20_ver=${app20_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh39_ipt2socks.sh 49 | if [ ! -f "/etc/storage/script/Sh39_ipt2socks.sh" ] || [ ! -s "/etc/storage/script/Sh39_ipt2socks.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh39_ipt2socks.sh "$hiboyscript/script/Sh39_ipt2socks.sh" "$hiboyscript/script/Sh39_ipt2socks.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_22.sh" ] || [ ! -s "/etc/storage/app_22.sh" ] ; then 54 | /etc/storage/script/Sh39_ipt2socks.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/koolproxy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_koolproxy.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set koolproxy_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set koolproxy_L2="$(($3 + 10))" 15 | nvram set koolproxy_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "koolproxy_L2"); %>,<% nvram_get_x("", "koolproxy_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/maddy: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app28.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_145=0 #maddy_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set maddy_L2="$(($3 + 10))" 16 | nvram set maddy_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "maddy_L2"); %>,<% nvram_get_x("", "maddy_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/maddy 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_maddyasp" ] ; then 26 | if [ ! -f "/opt/app/maddy/Advanced_Extensions_maddy.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_maddyasp /opt/app/maddy/Advanced_Extensions_maddy.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_maddyasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/maddy/Advanced_Extensions_maddy.asp" ] || [ ! -s "/opt/app/maddy/Advanced_Extensions_maddy.asp" ] ; then 33 | wgetcurl.sh /opt/app/maddy/Advanced_Extensions_maddy.asp "$hiboyfile/Advanced_Extensions_maddyasp" "$hiboyfile2/Advanced_Extensions_maddyasp" 34 | fi 35 | umount /www/Advanced_Extensions_app28.asp 36 | if [ -f "/opt/app/maddy/Advanced_Extensions_maddy.asp" ] ; then 37 | mount --bind /opt/app/maddy/Advanced_Extensions_maddy.asp /www/Advanced_Extensions_app28.asp 38 | app28_ver=$(grep 'app28_ver=' /opt/app/maddy/Advanced_Extensions_maddy.asp | awk -F '=' '{print $2;}') 39 | nvram set app28_ver=${app28_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh85_mad_dy.sh 49 | if [ ! -f "/etc/storage/script/Sh85_mad_dy.sh" ] || [ ! -s "/etc/storage/script/Sh85_mad_dy.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh85_mad_dy.sh "$hiboyscript/script/Sh85_mad_dy.sh" "$hiboyscript/script/Sh85_mad_dy.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_37.sh" ] || [ ! -s "/etc/storage/app_37.sh" ] ; then 54 | /etc/storage/script/Sh85_mad_dy.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/menu_title.txt: -------------------------------------------------------------------------------- 1 | 2025-05-01 -------------------------------------------------------------------------------- /www_sh/nps: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app14.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_60=0 #nps_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set nps_L2="$(($3 + 10))" 16 | nvram set nps_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "nps_L2"); %>,<% nvram_get_x("", "nps_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/nps 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_npsasp" ] ; then 26 | if [ ! -f "/opt/app/nps/Advanced_Extensions_nps.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_npsasp /opt/app/nps/Advanced_Extensions_nps.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_npsasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/nps/Advanced_Extensions_nps.asp" ] || [ ! -s "/opt/app/nps/Advanced_Extensions_nps.asp" ] ; then 33 | wgetcurl.sh /opt/app/nps/Advanced_Extensions_nps.asp "$hiboyfile/Advanced_Extensions_npsasp" "$hiboyfile2/Advanced_Extensions_npsasp" 34 | fi 35 | umount /www/Advanced_Extensions_app14.asp 36 | if [ -f "/opt/app/nps/Advanced_Extensions_nps.asp" ] ; then 37 | mount --bind /opt/app/nps/Advanced_Extensions_nps.asp /www/Advanced_Extensions_app14.asp 38 | app14_ver=$(grep 'app14_ver=' /opt/app/nps/Advanced_Extensions_nps.asp | awk -F '=' '{print $2;}') 39 | nvram set app14_ver=${app14_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh30_np_s.sh 49 | if [ ! -f "/etc/storage/script/Sh30_np_s.sh" ] || [ ! -s "/etc/storage/script/Sh30_np_s.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh30_np_s.sh "$hiboyscript/script/Sh30_np_s.sh" "$hiboyscript/script/Sh30_np_s.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_15.sh" ] || [ ! -s "/etc/storage/app_15.sh" ] || [ ! -f "/etc/storage/app_16.sh" ] || [ ! -s "/etc/storage/app_16.sh" ] ; then 54 | /etc/storage/script/Sh30_np_s.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/qcloud: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_qcloud.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set qcloud_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set qcloud_L2="$(($3 + 10))" 15 | nvram set qcloud_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "qcloud_L2"); %>,<% nvram_get_x("", "qcloud_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/ss_tproxy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app21.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_109=0 #ss_tproxy_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set ss_tproxy_L2="$(($3 + 10))" 16 | nvram set ss_tproxy_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "ss_tproxy_L2"); %>,<% nvram_get_x("", "ss_tproxy_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/ss_tproxy 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_ss_tproxyasp" ] ; then 26 | if [ ! -f "/opt/app/ss_tproxy/Advanced_Extensions_ss_tproxy.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_ss_tproxyasp /opt/app/ss_tproxy/Advanced_Extensions_ss_tproxy.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_ss_tproxyasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/ss_tproxy/Advanced_Extensions_ss_tproxy.asp" ] || [ ! -s "/opt/app/ss_tproxy/Advanced_Extensions_ss_tproxy.asp" ] ; then 33 | wgetcurl.sh /opt/app/ss_tproxy/Advanced_Extensions_ss_tproxy.asp "$hiboyfile/Advanced_Extensions_ss_tproxyasp" "$hiboyfile2/Advanced_Extensions_ss_tproxyasp" 34 | fi 35 | umount /www/Advanced_Extensions_app21.asp 36 | if [ -f "/opt/app/ss_tproxy/Advanced_Extensions_ss_tproxy.asp" ] ; then 37 | mount --bind /opt/app/ss_tproxy/Advanced_Extensions_ss_tproxy.asp /www/Advanced_Extensions_app21.asp 38 | app21_ver=$(grep 'app21_ver=' /opt/app/ss_tproxy/Advanced_Extensions_ss_tproxy.asp | awk -F '=' '{print $2;}') 39 | nvram set app21_ver=${app21_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh99_ss_tproxy.sh 49 | if [ ! -f "/etc/storage/script/Sh99_ss_tproxy.sh" ] || [ ! -s "/etc/storage/script/Sh99_ss_tproxy.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh99_ss_tproxy.sh "$hiboyscript/script/Sh99_ss_tproxy.sh" "$hiboyscript/script/Sh99_ss_tproxy.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_26.sh" ] || [ ! -s "/etc/storage/app_26.sh" ] || [ ! -f "/etc/storage/app_27.sh" ] || [ ! -s "/etc/storage/app_27.sh" ] ; then 54 | /etc/storage/script/Sh99_ss_tproxy.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/tailscale: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app11.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_82=0 #tailscale_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set tailscale_L2="$(($3 + 10))" 16 | nvram set tailscale_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "tailscale_L2"); %>,<% nvram_get_x("", "tailscale_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/tailscale 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_tailscaleasp" ] ; then 26 | if [ ! -f "/opt/app/tailscale/Advanced_Extensions_tailscale.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_tailscaleasp /opt/app/tailscale/Advanced_Extensions_tailscale.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_tailscaleasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/tailscale/Advanced_Extensions_tailscale.asp" ] || [ ! -s "/opt/app/tailscale/Advanced_Extensions_tailscale.asp" ] ; then 33 | wgetcurl.sh /opt/app/tailscale/Advanced_Extensions_tailscale.asp "$hiboyfile/Advanced_Extensions_tailscaleasp" "$hiboyfile2/Advanced_Extensions_tailscaleasp" 34 | fi 35 | umount /www/Advanced_Extensions_app11.asp 36 | if [ -f "/opt/app/tailscale/Advanced_Extensions_tailscale.asp" ] ; then 37 | mount --bind /opt/app/tailscale/Advanced_Extensions_tailscale.asp /www/Advanced_Extensions_app11.asp 38 | app11_ver=$(grep 'app11_ver=' /opt/app/tailscale/Advanced_Extensions_tailscale.asp | awk -F '=' '{print $2;}') 39 | nvram set app11_ver=${app11_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh89_tailscale.sh 49 | if [ ! -f "/etc/storage/script/Sh89_tailscale.sh" ] || [ ! -s "/etc/storage/script/Sh89_tailscale.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh89_tailscale.sh "$hiboyscript/script/Sh89_tailscale.sh" "$hiboyscript/script/Sh89_tailscale.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | 54 | [ "$1" = "del" ] && exit 55 | 56 | } 57 | 58 | if [ -f /tmp/webui_yes ] ; then 59 | get_www & 60 | get_app $1 & 61 | [ "$1" = "del" ] && exit 62 | fi 63 | 64 | -------------------------------------------------------------------------------- /www_sh/tgbot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app12.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_46=0 #tgbot_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set tgbot_L2="$(($3 + 10))" 16 | nvram set tgbot_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "tgbot_L2"); %>,<% nvram_get_x("", "tgbot_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/tgbot 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_tgbotasp" ] ; then 26 | if [ ! -f "/opt/app/tgbot/Advanced_Extensions_tgbot.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_tgbotasp /opt/app/tgbot/Advanced_Extensions_tgbot.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_tgbotasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/tgbot/Advanced_Extensions_tgbot.asp" ] || [ ! -s "/opt/app/tgbot/Advanced_Extensions_tgbot.asp" ] ; then 33 | wgetcurl.sh /opt/app/tgbot/Advanced_Extensions_tgbot.asp "$hiboyfile/Advanced_Extensions_tgbotasp" "$hiboyfile2/Advanced_Extensions_tgbotasp" 34 | fi 35 | umount /www/Advanced_Extensions_app12.asp 36 | if [ -f "/opt/app/tgbot/Advanced_Extensions_tgbot.asp" ] ; then 37 | mount --bind /opt/app/tgbot/Advanced_Extensions_tgbot.asp /www/Advanced_Extensions_app12.asp 38 | app12_ver=$(grep 'app12_ver=' /opt/app/tgbot/Advanced_Extensions_tgbot.asp | awk -F '=' '{print $2;}') 39 | nvram set app12_ver=${app12_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh50_tg_bot.sh 49 | if [ ! -f "/etc/storage/script/Sh50_tg_bot.sh" ] || [ ! -s "/etc/storage/script/Sh50_tg_bot.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh50_tg_bot.sh "$hiboyscript/script/Sh50_tg_bot.sh" "$hiboyscript/script/Sh50_tg_bot.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_10.sh" ] || [ ! -s "/etc/storage/app_10.sh" ] ; then 54 | /etc/storage/script/Sh50_tg_bot.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/tmall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app13.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_55=0 #tmall_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set tmall_L2="$(($3 + 10))" 16 | nvram set tmall_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "tmall_L2"); %>,<% nvram_get_x("", "tmall_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/tmall 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_tmallasp" ] ; then 26 | if [ ! -f "/opt/app/tmall/Advanced_Extensions_tmall.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_tmallasp /opt/app/tmall/Advanced_Extensions_tmall.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_tmallasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/tmall/Advanced_Extensions_tmall.asp" ] || [ ! -s "/opt/app/tmall/Advanced_Extensions_tmall.asp" ] ; then 33 | wgetcurl.sh /opt/app/tmall/Advanced_Extensions_tmall.asp "$hiboyfile/Advanced_Extensions_tmallasp" "$hiboyfile2/Advanced_Extensions_tmallasp" 34 | fi 35 | umount /www/Advanced_Extensions_app13.asp 36 | if [ -f "/opt/app/tmall/Advanced_Extensions_tmall.asp" ] ; then 37 | mount --bind /opt/app/tmall/Advanced_Extensions_tmall.asp /www/Advanced_Extensions_app13.asp 38 | app13_ver=$(grep 'app13_ver=' /opt/app/tmall/Advanced_Extensions_tmall.asp | awk -F '=' '{print $2;}') 39 | nvram set app13_ver=${app13_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh63_t_mall.sh 49 | if [ ! -f "/etc/storage/script/Sh63_t_mall.sh" ] || [ ! -s "/etc/storage/script/Sh63_t_mall.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh63_t_mall.sh "$hiboyscript/script/Sh63_t_mall.sh" "$hiboyscript/script/Sh63_t_mall.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_13.sh" ] || [ ! -s "/etc/storage/app_13.sh" ] || [ ! -f "/etc/storage/app_14.sh" ] || [ ! -s "/etc/storage/app_14.sh" ] ; then 54 | /etc/storage/script/Sh63_t_mall.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/translate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | # 失效清理 4 | echo "translate" -------------------------------------------------------------------------------- /www_sh/transocks: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app10.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_27=0 #transocks_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set transocks_L2="$(($3 + 10))" 16 | nvram set transocks_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "transocks_L2"); %>,<% nvram_get_x("", "transocks_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/transocks 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_transocksasp" ] ; then 26 | if [ ! -f "/opt/app/transocks/Advanced_Extensions_transocks.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_transocksasp /opt/app/transocks/Advanced_Extensions_transocks.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_transocksasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/transocks/Advanced_Extensions_transocks.asp" ] || [ ! -s "/opt/app/transocks/Advanced_Extensions_transocks.asp" ] ; then 33 | wgetcurl.sh /opt/app/transocks/Advanced_Extensions_transocks.asp "$hiboyfile/Advanced_Extensions_transocksasp" "$hiboyfile2/Advanced_Extensions_transocksasp" 34 | fi 35 | umount /www/Advanced_Extensions_app10.asp 36 | if [ -f "/opt/app/transocks/Advanced_Extensions_transocks.asp" ] ; then 37 | mount --bind /opt/app/transocks/Advanced_Extensions_transocks.asp /www/Advanced_Extensions_app10.asp 38 | app10_ver=$(grep 'app10_ver=' /opt/app/transocks/Advanced_Extensions_transocks.asp | awk -F '=' '{print $2;}') 39 | nvram set app10_ver=${app10_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh58_tran_socks.sh 49 | if [ ! -f "/etc/storage/script/Sh58_tran_socks.sh" ] || [ ! -s "/etc/storage/script/Sh58_tran_socks.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh58_tran_socks.sh "$hiboyscript/script/Sh58_tran_socks.sh" "$hiboyscript/script/Sh58_tran_socks.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_9.sh" ] || [ ! -s "/etc/storage/app_9.sh" ] ; then 54 | /etc/storage/script/Sh58_tran_socks.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/upd2pro: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app03.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_8=0 #upd2pro_enable 9 | nvram set app_9=0 #upd2pro2_enable 10 | nvram set app_18=0 #upd2pro3_enable 11 | exit 12 | fi 13 | 14 | if [ "$1" != "del" ] ; then 15 | eval 'nvram set tablink'$1'='$link';' 16 | 17 | nvram set upd2pro_L2="$(($3 + 10))" 18 | nvram set upd2pro_L3="$2" 19 | # show_menu(8,<% nvram_get_x("", "upd2pro_L2"); %>,<% nvram_get_x("", "upd2pro_L3"); %>); 20 | fi 21 | 22 | get_www () 23 | { 24 | 25 | # 加载程序配置页面 26 | mkdir -p /opt/app/upd2pro 27 | if [ -f "/tmp/www_asp/Advanced_Extensions_upd2proasp" ] ; then 28 | if [ ! -f "/opt/app/upd2pro/Advanced_Extensions_upd2pro.asp" ] ; then 29 | mv -f /tmp/www_asp/Advanced_Extensions_upd2proasp /opt/app/upd2pro/Advanced_Extensions_upd2pro.asp 30 | else 31 | rm -f /tmp/www_asp/Advanced_Extensions_upd2proasp 32 | fi 33 | fi 34 | if [ ! -f "/opt/app/upd2pro/Advanced_Extensions_upd2pro.asp" ] || [ ! -s "/opt/app/upd2pro/Advanced_Extensions_upd2pro.asp" ] ; then 35 | wgetcurl.sh /opt/app/upd2pro/Advanced_Extensions_upd2pro.asp "$hiboyfile/Advanced_Extensions_upd2proasp" "$hiboyfile2/Advanced_Extensions_upd2proasp" 36 | fi 37 | umount /www/Advanced_Extensions_app03.asp 38 | if [ -f "/opt/app/upd2pro/Advanced_Extensions_upd2pro.asp" ] ; then 39 | mount --bind /opt/app/upd2pro/Advanced_Extensions_upd2pro.asp /www/Advanced_Extensions_app03.asp 40 | app3_ver=$(grep 'app3_ver=' /opt/app/upd2pro/Advanced_Extensions_upd2pro.asp | awk -F '=' '{print $2;}') 41 | nvram set app3_ver=${app3_ver} 42 | fi 43 | 44 | } 45 | 46 | get_app () 47 | { 48 | 49 | # 更新程序启动脚本 50 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh26_upd2pro.sh 51 | if [ ! -f "/etc/storage/script/Sh26_upd2pro.sh" ] || [ ! -s "/etc/storage/script/Sh26_upd2pro.sh" ] ; then 52 | wgetcurl.sh /etc/storage/script/Sh26_upd2pro.sh "$hiboyscript/script/Sh26_upd2pro.sh" "$hiboyscript/script/Sh26_upd2pro.sh" 53 | fi 54 | chmod 777 /etc/storage/script -R 55 | # 初始配置脚本 56 | if [ ! -f "/etc/storage/app_3.sh" ] || [ ! -s "/etc/storage/app_3.sh" ] || [ ! -f "/etc/storage/app_4.sh" ] || [ ! -s "/etc/storage/app_4.sh" ] || [ ! -f "/etc/storage/app_6.sh" ] || [ ! -s "/etc/storage/app_6.sh" ] ; then 57 | /etc/storage/script/Sh26_upd2pro.sh update_app 58 | fi 59 | [ "$1" = "del" ] && exit 60 | 61 | } 62 | 63 | if [ -f /tmp/webui_yes ] ; then 64 | get_www & 65 | get_app $1 & 66 | [ "$1" = "del" ] && exit 67 | fi 68 | 69 | -------------------------------------------------------------------------------- /www_sh/v2ray: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_v2ray.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set v2ray_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set v2ray_L2="$(($3 + 10))" 15 | nvram set v2ray_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "v2ray_L2"); %>,<% nvram_get_x("", "v2ray_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/v2raya: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app29.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_146=0 #v2raya_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set v2raya_L2="$(($3 + 10))" 16 | nvram set v2raya_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "v2raya_L2"); %>,<% nvram_get_x("", "v2raya_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/v2raya 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_v2rayaasp" ] ; then 26 | if [ ! -f "/opt/app/v2raya/Advanced_Extensions_v2raya.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_v2rayaasp /opt/app/v2raya/Advanced_Extensions_v2raya.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_v2rayaasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/v2raya/Advanced_Extensions_v2raya.asp" ] || [ ! -s "/opt/app/v2raya/Advanced_Extensions_v2raya.asp" ] ; then 33 | wgetcurl.sh /opt/app/v2raya/Advanced_Extensions_v2raya.asp "$hiboyfile/Advanced_Extensions_v2rayaasp" "$hiboyfile2/Advanced_Extensions_v2rayaasp" 34 | fi 35 | umount /www/Advanced_Extensions_app29.asp 36 | if [ -f "/opt/app/v2raya/Advanced_Extensions_v2raya.asp" ] ; then 37 | mount --bind /opt/app/v2raya/Advanced_Extensions_v2raya.asp /www/Advanced_Extensions_app29.asp 38 | app29_ver=$(grep 'app29_ver=' /opt/app/v2raya/Advanced_Extensions_v2raya.asp | awk -F '=' '{print $2;}') 39 | nvram set app29_ver=${app29_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh84_v2raya.sh 49 | if [ ! -f "/etc/storage/script/Sh84_v2raya.sh" ] || [ ! -s "/etc/storage/script/Sh84_v2raya.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh84_v2raya.sh "$hiboyscript/script/Sh84_v2raya.sh" "$hiboyscript/script/Sh84_v2raya.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | 54 | [ "$1" = "del" ] && exit 55 | 56 | } 57 | 58 | if [ -f /tmp/webui_yes ] ; then 59 | get_www & 60 | get_app $1 & 61 | [ "$1" = "del" ] && exit 62 | fi 63 | 64 | -------------------------------------------------------------------------------- /www_sh/verysync: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app06.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_20=0 #verysync_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set verysync_L2="$(($3 + 10))" 16 | nvram set verysync_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "verysync_L2"); %>,<% nvram_get_x("", "verysync_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/verysync 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_verysyncasp" ] ; then 26 | if [ ! -f "/opt/app/verysync/Advanced_Extensions_verysync.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_verysyncasp /opt/app/verysync/Advanced_Extensions_verysync.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_verysyncasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/verysync/Advanced_Extensions_verysync.asp" ] || [ ! -s "/opt/app/verysync/Advanced_Extensions_verysync.asp" ] ; then 33 | wgetcurl.sh /opt/app/verysync/Advanced_Extensions_verysync.asp "$hiboyfile/Advanced_Extensions_verysyncasp" "$hiboyfile2/Advanced_Extensions_verysyncasp" 34 | fi 35 | umount /www/Advanced_Extensions_app06.asp 36 | if [ -f "/opt/app/verysync/Advanced_Extensions_verysync.asp" ] ; then 37 | mount --bind /opt/app/verysync/Advanced_Extensions_verysync.asp /www/Advanced_Extensions_app06.asp 38 | app6_ver=$(grep 'app6_ver=' /opt/app/verysync/Advanced_Extensions_verysync.asp | awk -F '=' '{print $2;}') 39 | nvram set app6_ver=${app6_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh55_very_sync.sh 49 | if [ ! -f "/etc/storage/script/Sh55_very_sync.sh" ] || [ ! -s "/etc/storage/script/Sh55_very_sync.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh55_very_sync.sh "$hiboyscript/script/Sh55_very_sync.sh" "$hiboyscript/script/Sh55_very_sync.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | 54 | [ "$1" = "del" ] && exit 55 | 56 | } 57 | 58 | if [ -f /tmp/webui_yes ] ; then 59 | get_www & 60 | get_app $1 & 61 | [ "$1" = "del" ] && exit 62 | fi 63 | 64 | -------------------------------------------------------------------------------- /www_sh/virtualhere: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app08.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_24=0 #virtualhere_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set virtualhere_L2="$(($3 + 10))" 16 | nvram set virtualhere_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "virtualhere_L2"); %>,<% nvram_get_x("", "virtualhere_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/virtualhere 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_virtualhereasp" ] ; then 26 | if [ ! -f "/opt/app/virtualhere/Advanced_Extensions_virtualhere.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_virtualhereasp /opt/app/virtualhere/Advanced_Extensions_virtualhere.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_virtualhereasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/virtualhere/Advanced_Extensions_virtualhere.asp" ] || [ ! -s "/opt/app/virtualhere/Advanced_Extensions_virtualhere.asp" ] ; then 33 | wgetcurl.sh /opt/app/virtualhere/Advanced_Extensions_virtualhere.asp "$hiboyfile/Advanced_Extensions_virtualhereasp" "$hiboyfile2/Advanced_Extensions_virtualhereasp" 34 | fi 35 | umount /www/Advanced_Extensions_app08.asp 36 | if [ -f "/opt/app/virtualhere/Advanced_Extensions_virtualhere.asp" ] ; then 37 | mount --bind /opt/app/virtualhere/Advanced_Extensions_virtualhere.asp /www/Advanced_Extensions_app08.asp 38 | app8_ver=$(grep 'app8_ver=' /opt/app/virtualhere/Advanced_Extensions_virtualhere.asp | awk -F '=' '{print $2;}') 39 | nvram set app8_ver=${app8_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh57_virtual_here.sh 49 | if [ ! -f "/etc/storage/script/Sh57_virtual_here.sh" ] || [ ! -s "/etc/storage/script/Sh57_virtual_here.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh57_virtual_here.sh "$hiboyscript/script/Sh57_virtual_here.sh" "$hiboyscript/script/Sh57_virtual_here.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_8.sh" ] || [ ! -s "/etc/storage/app_8.sh" ] ; then 54 | /etc/storage/script/Sh57_virtual_here.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/假装在中国: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app02.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_7=0 #fakeincn_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set fakeincn_L2="$(($3 + 10))" 16 | nvram set fakeincn_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "fakeincn_L2"); %>,<% nvram_get_x("", "fakeincn_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/fakeincn 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_fakeincnasp" ] ; then 26 | if [ ! -f "/opt/app/fakeincn/Advanced_Extensions_fakeincn.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_fakeincnasp /opt/app/fakeincn/Advanced_Extensions_fakeincn.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_fakeincnasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/fakeincn/Advanced_Extensions_fakeincn.asp" ] || [ ! -s "/opt/app/fakeincn/Advanced_Extensions_fakeincn.asp" ] ; then 33 | wgetcurl.sh /opt/app/fakeincn/Advanced_Extensions_fakeincn.asp "$hiboyfile/Advanced_Extensions_fakeincnasp" "$hiboyfile2/Advanced_Extensions_fakeincnasp" 34 | fi 35 | umount /www/Advanced_Extensions_app02.asp 36 | if [ -f "/opt/app/fakeincn/Advanced_Extensions_fakeincn.asp" ] ; then 37 | mount --bind /opt/app/fakeincn/Advanced_Extensions_fakeincn.asp /www/Advanced_Extensions_app02.asp 38 | app2_ver=$(grep 'app2_ver=' /opt/app/fakeincn/Advanced_Extensions_fakeincn.asp | awk -F '=' '{print $2;}') 39 | nvram set app2_ver=${app2_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh20_fakeincn.sh /etc/storage/app_2.sh /etc/storage/app_12.sh 49 | if [ ! -f "/etc/storage/script/Sh20_fakeincn.sh" ] || [ ! -s "/etc/storage/script/Sh20_fakeincn.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh20_fakeincn.sh "$hiboyscript/script/Sh20_fakeincn.sh" "$hiboyscript/script/Sh20_fakeincn.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | # 初始配置脚本 54 | if [ ! -f "/etc/storage/app_1.sh" ] || [ ! -s "/etc/storage/app_1.sh" ] || [ ! -f "/etc/storage/app_2.sh" ] || [ ! -s "/etc/storage/app_2.sh" ] || [ ! -f "/etc/storage/app_12.sh" ] || [ ! -s "/etc/storage/app_12.sh" ] ; then 55 | /etc/storage/script/Sh20_fakeincn.sh update_app 56 | fi 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/家庭云提速: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 失效清理 3 | echo "speedup" 4 | -------------------------------------------------------------------------------- /www_sh/微信推送: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 失效清理 3 | echo "ServerChan" 4 | -------------------------------------------------------------------------------- /www_sh/搭建Web环境: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_lnmp.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set lnmp_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set lnmp_L2="$(($3 + 10))" 15 | nvram set lnmp_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "lnmp_L2"); %>,<% nvram_get_x("", "lnmp_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/相框设置: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_display.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set display_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set display_L2="$(($3 + 10))" 15 | nvram set display_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "display_L2"); %>,<% nvram_get_x("", "display_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/网页终端: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_shellinabox.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set shellinabox_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set shellinabox_L2="$(($3 + 10))" 15 | nvram set shellinabox_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "shellinabox_L2"); %>,<% nvram_get_x("", "shellinabox_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/自建微信推送: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app22.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_123=0 #wxsend_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set wxsend_L2="$(($3 + 10))" 16 | nvram set wxsend_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "wxsend_L2"); %>,<% nvram_get_x("", "wxsend_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/wxsend 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_wxsendasp" ] ; then 26 | if [ ! -f "/opt/app/wxsend/Advanced_Extensions_wxsend.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_wxsendasp /opt/app/wxsend/Advanced_Extensions_wxsend.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_wxsendasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/wxsend/Advanced_Extensions_wxsend.asp" ] || [ ! -s "/opt/app/wxsend/Advanced_Extensions_wxsend.asp" ] ; then 33 | wgetcurl.sh /opt/app/wxsend/Advanced_Extensions_wxsend.asp "$hiboyfile/Advanced_Extensions_wxsendasp" "$hiboyfile2/Advanced_Extensions_wxsendasp" 34 | fi 35 | umount /www/Advanced_Extensions_app22.asp 36 | if [ -f "/opt/app/wxsend/Advanced_Extensions_wxsend.asp" ] ; then 37 | mount --bind /opt/app/wxsend/Advanced_Extensions_wxsend.asp /www/Advanced_Extensions_app22.asp 38 | app22_ver=$(grep 'app22_ver=' /opt/app/wxsend/Advanced_Extensions_wxsend.asp | awk -F '=' '{print $2;}') 39 | nvram set app22_ver=${app22_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh45_wx_send.sh 49 | if [ ! -f "/etc/storage/script/Sh45_wx_send.sh" ] || [ ! -s "/etc/storage/script/Sh45_wx_send.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh45_wx_send.sh "$hiboyscript/script/Sh45_wx_send.sh" "$hiboyscript/script/Sh45_wx_send.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | if [ ! -f "/etc/storage/app_30.sh" ] || [ ! -s "/etc/storage/app_30.sh" ] || [ ! -f "/etc/storage/app_31.sh" ] || [ ! -s "/etc/storage/app_31.sh" ] ; then 54 | /etc/storage/script/Sh45_wx_send.sh update_app 55 | fi 56 | 57 | [ "$1" = "del" ] && exit 58 | 59 | } 60 | 61 | if [ -f /tmp/webui_yes ] ; then 62 | get_www & 63 | get_app $1 & 64 | [ "$1" = "del" ] && exit 65 | fi 66 | 67 | -------------------------------------------------------------------------------- /www_sh/花生壳内网版: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_phddns.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set phddns=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set phddns_L2="$(($3 + 10))" 15 | nvram set phddns_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "phddns_L2"); %>,<% nvram_get_x("", "phddns_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_sh/连接打印机: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_app04.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set app_10=0 #printer_enable 9 | exit 10 | fi 11 | 12 | if [ "$1" != "del" ] ; then 13 | eval 'nvram set tablink'$1'='$link';' 14 | 15 | nvram set printer_L2="$(($3 + 10))" 16 | nvram set printer_L3="$2" 17 | # show_menu(8,<% nvram_get_x("", "printer_L2"); %>,<% nvram_get_x("", "printer_L3"); %>); 18 | fi 19 | 20 | get_www () 21 | { 22 | 23 | # 加载程序配置页面 24 | mkdir -p /opt/app/printer 25 | if [ -f "/tmp/www_asp/Advanced_Extensions_printerasp" ] ; then 26 | if [ ! -f "/opt/app/printer/Advanced_Extensions_printer.asp" ] ; then 27 | mv -f /tmp/www_asp/Advanced_Extensions_printerasp /opt/app/printer/Advanced_Extensions_printer.asp 28 | else 29 | rm -f /tmp/www_asp/Advanced_Extensions_printerasp 30 | fi 31 | fi 32 | if [ ! -f "/opt/app/printer/Advanced_Extensions_printer.asp" ] || [ ! -s "/opt/app/printer/Advanced_Extensions_printer.asp" ] ; then 33 | wgetcurl.sh /opt/app/printer/Advanced_Extensions_printer.asp "$hiboyfile/Advanced_Extensions_printerasp" "$hiboyfile2/Advanced_Extensions_printerasp" 34 | fi 35 | umount /www/Advanced_Extensions_app04.asp 36 | if [ -f "/opt/app/printer/Advanced_Extensions_printer.asp" ] ; then 37 | mount --bind /opt/app/printer/Advanced_Extensions_printer.asp /www/Advanced_Extensions_app04.asp 38 | app4_ver=$(grep 'app4_ver=' /opt/app/printer/Advanced_Extensions_printer.asp | awk -F '=' '{print $2;}') 39 | nvram set app4_ver=${app4_ver} 40 | fi 41 | 42 | } 43 | 44 | get_app () 45 | { 46 | 47 | # 更新程序启动脚本 48 | [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh27_printer.sh 49 | if [ ! -f "/etc/storage/script/Sh27_printer.sh" ] || [ ! -s "/etc/storage/script/Sh27_printer.sh" ] ; then 50 | wgetcurl.sh /etc/storage/script/Sh27_printer.sh "$hiboyscript/script/Sh27_printer.sh" "$hiboyscript/script/Sh27_printer.sh" 51 | fi 52 | chmod 777 /etc/storage/script -R 53 | # 初始配置脚本 54 | 55 | [ "$1" = "del" ] && exit 56 | 57 | } 58 | 59 | if [ -f /tmp/webui_yes ] ; then 60 | get_www & 61 | get_app $1 & 62 | [ "$1" = "del" ] && exit 63 | fi 64 | 65 | -------------------------------------------------------------------------------- /www_sh/配置扩展环境: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_script.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set syncthing_enable=0 9 | nvram set FastDick_enable=0 10 | nvram set tinyproxy_enable=0 11 | nvram set mproxy_enable=0 12 | nvram set vpnproxy_enable=0 13 | exit 14 | fi 15 | 16 | eval 'nvram set tablink'$1'='$link';' 17 | 18 | nvram set script_L2="$(($3 + 10))" 19 | nvram set script_L3="$2" 20 | # show_menu(8,<% nvram_get_x("", "script_L2"); %>,<% nvram_get_x("", "script_L3"); %>); 21 | 22 | -------------------------------------------------------------------------------- /www_sh/锐捷认证: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #copyright by hiboy 3 | source /etc/storage/script/init.sh 4 | 5 | link="Advanced_Extensions_mentohust.asp" 6 | echo $1 7 | if [ "$1"x = "stop"x ] ; then 8 | nvram set mentohust_enable=0 9 | exit 10 | fi 11 | 12 | eval 'nvram set tablink'$1'='$link';' 13 | 14 | nvram set mentohust_L2="$(($3 + 10))" 15 | nvram set mentohust_L3="$2" 16 | # show_menu(8,<% nvram_get_x("", "mentohust_L2"); %>,<% nvram_get_x("", "mentohust_L3"); %>); 17 | 18 | -------------------------------------------------------------------------------- /www_shsh.txt: -------------------------------------------------------------------------------- 1 | 锐捷认证=bfb7b9ede43c90a1ca92e3c37b247ad5 2 | 配置扩展环境=d82558ea8fc61efc48ddf109cc538478 3 | 连接打印机=11827748838d22c46f10450c664ca1e6 4 | 花生壳内网版=e39f780b2f08bdf5d44f6fc7d2848d8a 5 | 自建微信推送=9c0a777ac3fffe0c02e53106cb5a9f03 6 | 网页终端=0347e48c303d13db54e7a69e9a1484f9 7 | 相框设置=9ed72bd74ee92730c99a1e5bdb5ed2ac 8 | 搭建Web环境=2c45dc1f96b52f491c635ddb857a50ea 9 | 微信推送=f70672d59766447ca21f9ede537cc44a 10 | 家庭云提速=0e74be0fc54758cfba46e9d9d427c576 11 | 假装在中国=e432497d85c3ec2f7f876e4389c083fd 12 | virtualhere=d61b43f115398c6ac385877183130937 13 | verysync=69127742a161eb2a940f394ffa0c2305 14 | v2raya=207261ebdaa1778016f40ac67aac086f 15 | v2ray=23742239a6cabd49c19090b6c5199041 16 | upd2pro=65bed9f33dbe8f67b0b2b936c462f3de 17 | transocks=c65f00157d10379c036bc8edca47e474 18 | translate=d30f1007c1737c99581b86d5dbb51c0d 19 | tmall=697549a242e1b500caa59cd30b030c33 20 | tgbot=b027de1d336847d3e44cbc03c604a443 21 | tailscale=9eb3d70e374164543ada3aa9c73e4d54 22 | ss_tproxy=9f9f590ccd7655a5e33cb8df6b7ffb77 23 | qcloud=7fb08fef7f8eed1c5432a19b73676ef2 24 | nps=9296a26d8dcc4eafce5ef914be07bd1c 25 | menu_title.txt=5fb0249083e9195df43b4f0c96fd6ed4 26 | maddy=ad01974dd4f7da163a16ba43bbd868f5 27 | koolproxy=ad67b03b972a05d4175feb625061a428 28 | ipt2socks=0e0b3ab1ab78267167e607cb60e26fa6 29 | hysteria=72290b4c7027f2279ac1a4eb5f3adcc7 30 | huaweidns=008942740d2d8baeb8048e701c5d9b89 31 | guestkit=0e12bdfd77189659539ccb322c590816 32 | gotify推送=00bbc5670f0f8423ee7e2123c2bd1fce 33 | goflyway=b0f98f89275e79f853065557d7c8c7d4 34 | gocryptfs=a11baf03c0e145b47c060b07a7076827 35 | frp=b2f3b75c8bc9a026f6b3cd88de5d0051 36 | filemanager=6ba76bbff8838f0acf2fc8390c8d1d08 37 | ddnsto=700f58944f0dc22c327622a39a0e2b7a 38 | ddnsgo=cc31625925fbfe62b3137524856a8d00 39 | cryfs=b99a992289dd39effac9b22b5f9d7e35 40 | cloudflare=e7489e03352ddc600e9b6ac7c83be322 41 | clash=3d79c81042c14ef82479e176fc013434 42 | chinadns_ng=6fc27a719a0bf2da09e9cc0a23d7030f 43 | chinadns=3e8b524fb71317144b77c015fd404bcb 44 | caddy=e457e256955b31b48659372fce7170b6 45 | Zoraxy=3a4ea863ae749b7cc09ab216ade48d95 46 | Wifidog=01e112386677218defc52f37c060d96e 47 | SoftEtherVPN=3f6466dc7bbc8c9885efa682049e274e 48 | SS配置=1ca2b10bc214a0965a52f3a6403ac5db 49 | SS节点=54fe0b8272bc7fce3ac8cc35c8a5ea95 50 | SS_Server=0dda0dc7881abac1bc1f6b2fa62d2d34 51 | SSR_Server=72a76763fbfbd6a175d23bab0a6773e3 52 | Ngrok=f53261166b84eb1c5a8227ae766831e3 53 | MEOW=fce46662d9453243301041610a6df42d 54 | Kcptun=ff06f0a5dd350d6de83316f6227ff449 55 | DNSPod=300394e11bc614e0421a253028bbc262 56 | CloudXNS=ad2cbd0aa8bf0ff91cac874be17302f9 57 | COW=fc42214d247a7b1ab3d4b8e09267b517 58 | ArozOS=23de063730eb656bd05cce47a1cdb403 59 | Aliddns=3a6438e794ecee9135a07364274c98f4 60 | Adbyby=17c312aba326336503121afbe238a7f1 61 | AdGuardHome=ba653613cecf28214999d26ff3bee482 62 | ADM=8b6755ca7fd693f97fab48c0aaba9aa1 63 | menu_title.sh=18a8b06693f407db96d40316ef58fbfb 64 | --------------------------------------------------------------------------------