Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- showStaticIPWindow()
- {
- IP_ADDRESS="$(ifconfig $INTERFACE | grep 'inet addr' | sed 's/.*inet addr://' | cut -d" " -f1)"
- NETMASK="$(ifconfig $INTERFACE | grep 'inet addr' | sed 's/.*Mask://')"
- GATEWAY="$(iproute | grep default | cut -d" " -f3)"
- # get current dns servers
- NUM=1
- while read A B ; do
- if [ "$A" = "nameserver" ] && dotquad "$B" ; then # being really paranoid...
- eval DNS_SERVER$NUM="$B"
- NUM=$((NUM+1))
- fi
- done<<EOF
- $( grep -m2 nameserver /etc/resolv.conf )
- EOF
- EXIT=""
- while true
- do
- buildStaticIPWindow
- I=$IFS; IFS=""
- for STATEMENT in $(gtkdialog3 --program NETWIZ_Static_IP_Window); do
- eval $STATEMENT
- done
- IFS=$I
- clean_up_gtkdialog NETWIZ_Static_IP_Window
- unset NETWIZ_Static_IP_Window
- case "$EXIT" in
- abort|Cancel) # close window
- break
- ;; # Do Nothing, It will exit without doing anything
- #"21" ) # Help
- #showHelp
- #;;
- "OK" ) # OK
- if validateStaticIP ; then
- setupStaticIP || EXIT=""
- else
- EXIT=""
- fi
- break
- ;;
- esac
- done
- if [ "${EXIT}" = "OK" ] ; then
- return 0
- else
- return 1
- fi
- } # end showStaticIPWindow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement