Compare commits
2 Commits
8094725d80
...
d4f7445e26
| Author | SHA1 | Date | |
|---|---|---|---|
| d4f7445e26 | |||
| 79661b773f |
40
menuIP.sh
Normal file
40
menuIP.sh
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
clear
|
||||||
|
echo "==============================="
|
||||||
|
echo " MAIN MENU "
|
||||||
|
echo "==============================="
|
||||||
|
echo "1. Check your external IP"
|
||||||
|
echo "2. List directory contents"
|
||||||
|
echo "3. Ping google.com (5 times)"
|
||||||
|
echo "4. Exit"
|
||||||
|
echo "-------------------------------"
|
||||||
|
read -p "Enter option number: " option
|
||||||
|
case $option in
|
||||||
|
1)
|
||||||
|
echo
|
||||||
|
echo "Your external IP is:"
|
||||||
|
curl -s https://api.ipify.org
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
echo
|
||||||
|
echo "Directory contents:"
|
||||||
|
ls -la
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
echo
|
||||||
|
echo "Pinging google.com (5 times):"
|
||||||
|
ping -c 5 google.com
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
echo "Exiting..."
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid option. Please try again."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo
|
||||||
|
read -p "Press Enter to continue..."
|
||||||
|
done
|
||||||
40
menu_external_ip.sh
Normal file
40
menu_external_ip.sh
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
clear
|
||||||
|
echo "==============================="
|
||||||
|
echo " MAIN MENU "
|
||||||
|
echo "==============================="
|
||||||
|
echo "1. Check your external IP"
|
||||||
|
echo "2. List directory contents"
|
||||||
|
echo "3. Ping google.com (5 times)"
|
||||||
|
echo "4. Exit"
|
||||||
|
echo "-------------------------------"
|
||||||
|
read -p "Enter option number: " option
|
||||||
|
case $option in
|
||||||
|
1)
|
||||||
|
echo
|
||||||
|
echo "Your external IP is:"
|
||||||
|
curl -s https://api.ipify.org
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
echo
|
||||||
|
echo "Directory contents:"
|
||||||
|
ls -la
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
echo
|
||||||
|
echo "Pinging google.com (5 times):"
|
||||||
|
ping -c 5 google.com
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
echo "Exiting..."
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid option. Please try again."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo
|
||||||
|
read -p "Press Enter to continue..."
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user