code:
#!/bin/bash

#dialog --backtitle "Gateway Change Interface"
route | grep default | awk '{print $2}'

dialog --clear --title "Gateway Change Interface" \
--menu "To move [UP/DOWN] arrow keys \n\
[Enter] to Select\n\
Your Current Gateway : $(/sbin/route | grep default | awk '{print $2}') \n\
Change Gateway To" 20 51 4 \
"192.168.1.111" "Linux Gateway" \
"192.168.1.2" "Windows Gateway"\
"192.168.1.155" "Cisco Gateway"\
"Exit" "To exit this Program" 2> /tmp/menuitem.$$

menuitem=`cat /tmp/menuitem.$$`
opt=$?

case $menuitem in
192.168.1.111) /sbin/ip route change default via 192.168.1.111;;
192.168.1.2) /sbin/ip route change default via 192.168.1.2;;
192.168.1.155) /sbin/ip route change default via 192.168.1.155;;
esac
rm /tmp/menuitem.$$
clear