40 lines
975 B
Bash
40 lines
975 B
Bash
#!/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 |