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