prompt_location() {
file_location="${root}/filename"
iter=1
export iter
echo "Please choose a location/site:"
cat $file_location | while read line
do
sname=`echo $line | cut -d':' -f 1`
echo "("$iter")" $sname
iter=`expr $iter + 1`
done
echo -n "[1] "
read snum
max=`wc -l $file_location | cut -d ' ' -f 1`
if [ $snum -le $max ]
then
myline=`cat $file_location | head -$snum | tail -1`
site_name=`echo $myline | cut -d':' -f 1`
site_dns1=`echo $myline | cut -d':' -f 2`
site_dns2=`echo $myline | cut -d':' -f 3`
site_tz=`echo $myline | cut -d':' -f 4`
clear
else
[ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE
echo 'Invalid selection'
[ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
prompt_location
fi
}
|