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