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