when I try the code it only shows the menu and prompt!!! but it should do some jobs for any choice by case!!!
Code:
set -vx
DD=$(date --date="yesterday" +%a" "%b" "%d)
TIME=$(date +%T)
echo $DD
tabs -20
PS3="^[[32mPlease enter your choice: "
echo ^[[0m
select choice in "Test VPN " "Test APN" "Exit"
do
case "$choice" in
1) fping -ga 10.8.0.0/24>IPvar; usr=check; break;;
2) fping -ga 192.168.40.0/24>IPvar; usr=root; break;;
3) exit 0;;
esac
done
cat IPvar
`^L`
while read IP
do
rm -f rbtdate.txt
rm -f rbt.txt
ssh -n $usr@$IP 'hostname;date +%T;last reboot|head -30'>rbt.txt
echo ^[[36m
cat rbt.txt|head -2|tr '\n' '\t'
cut -c 40-50 rbt.txt>rbtdate.txt
awk '$1=gensub(" "," 0",$1) ~ '/"$DD"/' {++c} END {print c}' FS=: rbtdate.txt
echo ^[[37m
done <IPvar
~