Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- internal="$(ip route get 8.8.8.8 | awk '{print $NF;exit}')"
- external="$(dig +short myip.opendns.com @resolver1.opendns.com)"
- echo "Which IP you want to use?"
- options=(
- "Internal IP"
- "External IP"
- "Manual IP"
- "Next"
- )
- select option in "${options[@]}"
- do
- case "$REPLY" in
- 1) echo "Internal IP: $internal was selected."
- ip=$internal ;;
- 2) echo "External IP: $external was selected."
- ip=$external;;
- 3) echo "Enter the IP Manually."
- read input;
- ip=$input
- echo "Manual IP: $ip was selected.";;
- 4) break ;;
- *) echo "Please select a valid option" ;;
- esac
- done
- echo "fuck yea"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement