Hello ,
im sorry for my english .
im trying to create a dynamic menu that will display if the interface is ACTIVE OR STOPPED/FAILED
for some reason i cant get it to work properly
start_interface_func()
{
i=0
for interface_chk in 11 71 73 72 12 47 48 49 50 20 23 24 25 46 21 22 27 28 29 403 62 45 60 13 402 401 4 44 26
do
interface_state[$i]=`cat /tmp/oper/tmp_fnex_file_1 | grep $interface_chk | awk '{ print $2}'`
i=$(( $i + 1 ))
done
}
start_interface_func
while true
do
clear
echo "\n"
echo "\n"
echo "---------------- AAA --------------=---------------- BG ----------------"
echo " ="
echo "1) AAA 1 -11- ${interface_state[0]} = 5) BG 1 -12- ${interface_state[4]}"
echo "2) AAA 2 -71- ${interface_state[1]} = 6) BG 2 -47- ${interface_state[5]}"
echo "3) AAA 2 -73- ${interface_state[2]} = 7) BG 3 -48- ${interface_state[6]}"
echo "4) AAA 3 -72- ${interface_state[3]} = 8) BG 4 -49- ${interface_state[7]}"
echo " = 9) BG 5 -50- ${interface_state[8]}"
echo " ="
echo "---------------- GHLR -------------=---------------- SAiHLR --------------"
echo " ="
echo "10) TAP fasr port 1 -20- ${interface_state[9]} = 20) DRP SAiHLR -403- ${interface_state[19]}"
echo "11) TAP fasr port 2 -23- ${interface_state[10]} = 21) NSA DAP DRP -62- ${interface_state[20]}"
echo "12) TAP fasr port 3 -24- ${interface_state[11]} = 22) SAiHLR 1 -45- ${interface_state[21]}"
echo "13) TAP fasr port 4 -25- ${interface_state[12]} = 23) SAiHLR 2 -60- ${interface_state[22]}"
echo "14) TAP fasr port 5 -46- ${interface_state[13]} =---------------- PPS --------------"
echo "15) TAP fasr port 6 -21- ${interface_state[14]} = 24) PPS 1 -13- ${interface_state[23]}"
echo "16) TAP fasr port 7 -22- ${interface_state[15]} = 25) PPS Bill -402- ${interface_state[24]}"
echo "17) TAP fasr port 8 -27- ${interface_state[16]} =---------------- NDM --------------"
echo "18) TAP fasr port 9 -28- ${interface_state[17]} = 26) NDM -401- ${interface_state[25]}"
echo "19) TAP fasr port 10 -29- ${interface_state[18]} ="
echo " ="
echo "---------------- VMP --------------=---------------- 3PPG --------------"
echo "27) VMP 10 -4- ${interface_state[26]} = 29) 3PPG -26- ${interface_state[28]}"
echo "28) VMP 2nd xface -44- ${interface_state[27]} ="
echo "\n"
echo "31) Start All GHLR Interfaces"
echo "32) Stop All GHLR Interfaces"
echo "33) Start All SAiHLR Interfaces"
echo "34) Stop All SAiHLR Interfaces"
echo "\n"
echo " 35) Main Menu "
echo "\n"
echo "Enter your menu choice [1-35]: "
read selchoice
case $selchoice in
1) read;;
2) read;;
3) read;;
esac
done
and this is what i get :
---------------- AAA --------------=---------------- BG ----------------
=
1) AAA 1 -11- ACTIVE = 5) BG 1 -12- ACTIVE
2) AAA 2 -71- FAILED = 6) BG 2 -47- ACTIVE
3) AAA 2 -73- ACTIVE = 7) BG 3 -48- ACTIVE
4) AAA 3 -72- ACTIVE = 8) BG 4 -49- ACTIVE
= 9) BG 5 -50- ACTIVE
=
---------------- GHLR -------------=---------------- SAiHLR --------------
=
10) TAP fasr port 1 -20- ACTIVE = 20) DRP SAiHLR -403- ACTIVE
11) TAP fasr port 2 -23- ACTIVE = 21) NSA DAP DRP -62- ACTIVE
12) TAP fasr port 3 -24- ACTIVE = 22) SAiHLR 1 -45- ACTIVE
13) TAP fasr port 4 -25- ACTIVE = 23) SAiHLR 2 -60- ACTIVE
14) TAP fasr port 5 -46- ACTIVE =---------------- PPS --------------
15) TAP fasr port 6 -21- ACTIVE = 24) PPS 1 -13- ACTIVE
16) TAP fasr port 7 -22- ACTIVE = 25) PPS Bill -402- ACTIVE
17) TAP fasr port 8 -27- ACTIVE =---------------- NDM --------------
18) TAP fasr port 9 -28- ACTIVE = 26) NDM -401- ACTIVE
19) TAP fasr port 10 -29- ACTIVE =
=
---------------- VMP --------------=---------------- 3PPG --------------
27) VMP 10 -4- ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
FAILED = 29) 3PPG -26- ACTIVE
28) VMP 2nd xface -44- ACTIVE =
31) Start All GHLR Interfaces
32) Stop All GHLR Interfaces
33) Start All SAiHLR Interfaces
34) Stop All SAiHLR Interfaces
35) Main Menu
Enter your menu choice [1-35]:
Thank You
