Changeset 584

Show
Ignore:
Timestamp:
12/18/10 19:42:26 (17 months ago)
Author:
JulioCP
Message:

nightwing-wa: Added to nw_conf the configuration related to TrustedMACList for NDS.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/nightwing-wa/nightwing/usr/bin/nw_conf

    r523 r584  
    754754} 
    755755 
     756 
     757case_tml_act(){ 
     758        read ACT 
     759        case $ACT in 
     760                y|Y) 
     761                        uci set nodogsplash.trustedmaclist.active=1 
     762                        uci commit nodogsplash 
     763                        echo "TrustedMACList activated." 
     764                        ;; 
     765                n|N) 
     766                        echo $NOCHANGED_MSG 
     767                        ;; 
     768                *) 
     769                        echo "$RU is not a valid option" 
     770                        echo "[y/n]: " 
     771                        case_tml_act 
     772                        ;; 
     773                esac             
     774} 
     775 
     776case_tml_deact(){ 
     777        read DEACT 
     778        case $DEACT in 
     779                y|Y) 
     780                        uci set nodogsplash.trustedmaclist.active=0 
     781                        uci commit nodogsplash 
     782                        echo "TrustedMACList deactivated." 
     783                        ;; 
     784                n|N) 
     785                        echo $NOCHANGED_MSG 
     786                        ;; 
     787                *) 
     788                        echo "$RU is not a valid option" 
     789                        echo "[y/n]: " 
     790                        case_tml_deact 
     791                        ;; 
     792                esac             
     793} 
     794 
     795case_tml_wrong(){ 
     796        read ACT 
     797        case $ACT in 
     798                y|Y) 
     799                        echo "Enter 1 to activate it or 0 to deactivate it." 
     800                        read WRONG 
     801                        uci set nodogsplash.trustedmaclist.active=$WRONG 
     802                        uci commit nodogsplash 
     803                        ;; 
     804                n|N) 
     805                        echo $NOCHANGED_MSG 
     806                        ;; 
     807                *) 
     808                        echo "$RU is not a valid option" 
     809                        echo "[y/n]: " 
     810                        case_tml_act 
     811                        ;; 
     812                esac             
     813} 
     814 
     815 
     816 
    756817clear 
    757818echo -e "\033[1m **************** NoDogSplash Config ***************\033[0m" 
     
    760821echo -e "\033[1m b.\033[0m Change Gateway Name" 
    761822echo -e "\033[1m c.\033[0m Change Redirect URL" 
    762 echo -e "\033[1m d.\033[0m Back to main menu" 
     823echo -e "\033[1m d.\033[0m Activate/Deactivate TrustedMACList" 
     824echo -e "\033[1m e.\033[0m Back to main menu" 
    763825echo -n "Select an option [a - d]: " 
    764826read val5 
     
    784846                ;; 
    785847        d|D) 
    786                 ;; 
    787          
     848                TML=$(uci get nodogsplash.trustedmaclist.active) 
     849                if [ $TML -eq 1 ]; then 
     850                    echo "TrustedMACList is activated." 
     851                    echo "Do you want to deactivate TrustedMACList?" 
     852                    echo "[y/n]: " 
     853                    case_tml_deact 
     854                    sleep 2 
     855                    menu_5 
     856                     
     857                elif [ $TML -eq 0 ]; then 
     858                    echo "TrustedMACList is not activated." 
     859                    echo "Do you want to activate TrustedMACList?" 
     860                    echo "[y/n]: " 
     861                    case_tml_act 
     862                    sleep 2 
     863                    menu_5 
     864                else 
     865                    echo "TrustedMACList has a wrong setting." 
     866                    echo "Do you want to set a propper setting?" 
     867                    echo "[y/n]: " 
     868                    case_tml_wrong 
     869                    sleep 2 
     870                    menu_5 
     871                fi 
     872                ;; 
     873        e|E) 
     874                ;; 
    788875        *) 
    789876                menu_5