#!/bin/bash #copyright by hiboy source /etc/storage/script/init.sh link="Advanced_Extensions_app20.asp" echo $1 if [ "$1"x = "stop"x ] ; then nvram set app_104=0 #ipt2socks_enable exit fi if [ "$1" != "del" ] ; then eval 'nvram set tablink'$1'='$link';' nvram set ipt2socks_L2="$(($3 + 10))" nvram set ipt2socks_L3="$2" # show_menu(8,<% nvram_get_x("", "ipt2socks_L2"); %>,<% nvram_get_x("", "ipt2socks_L3"); %>); fi get_www () { # 加载程序配置页面 mkdir -p /opt/app/ipt2socks if [ -f "/tmp/www_asp/Advanced_Extensions_ipt2socksasp" ] ; then if [ ! -f "/opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp" ] ; then mv -f /tmp/www_asp/Advanced_Extensions_ipt2socksasp /opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp else rm -f /tmp/www_asp/Advanced_Extensions_ipt2socksasp fi fi if [ ! -f "/opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp" ] || [ ! -s "/opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp" ] ; then wgetcurl.sh /opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp "$hiboyfile/Advanced_Extensions_ipt2socksasp" "$hiboyfile2/Advanced_Extensions_ipt2socksasp" fi umount /www/Advanced_Extensions_app20.asp if [ -f "/opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp" ] ; then mount --bind /opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp /www/Advanced_Extensions_app20.asp app20_ver=$(grep 'app20_ver=' /opt/app/ipt2socks/Advanced_Extensions_ipt2socks.asp | awk -F '=' '{print $2;}') nvram set app20_ver=${app20_ver} fi } get_app () { # 更新程序启动脚本 [ "$1" = "del" ] && rm -rf /etc/storage/script/Sh39_ipt2socks.sh if [ ! -f "/etc/storage/script/Sh39_ipt2socks.sh" ] || [ ! -s "/etc/storage/script/Sh39_ipt2socks.sh" ] ; then wgetcurl.sh /etc/storage/script/Sh39_ipt2socks.sh "$hiboyscript/script/Sh39_ipt2socks.sh" "$hiboyscript/script/Sh39_ipt2socks.sh" fi chmod 777 /etc/storage/script -R if [ ! -f "/etc/storage/app_22.sh" ] || [ ! -s "/etc/storage/app_22.sh" ] ; then /etc/storage/script/Sh39_ipt2socks.sh update_app fi [ "$1" = "del" ] && exit } if [ -f /tmp/webui_yes ] ; then get_www & get_app $1 & [ "$1" = "del" ] && exit fi