From 79661b773f9057cfb6e311a33b9d042197f6a705 Mon Sep 17 00:00:00 2001 From: "DESKTOP-F8P3LSJ\\augusto\\dev" Date: Tue, 22 Jul 2025 15:54:19 -0400 Subject: [PATCH] Add menu_external_ip.sh script to provide a user-friendly interface for checking external IP, listing directory contents, and pinging Google. Includes error handling and prompts for improved user experience. --- menu_external_ip.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 menu_external_ip.sh diff --git a/menu_external_ip.sh b/menu_external_ip.sh new file mode 100644 index 0000000..b88549f --- /dev/null +++ b/menu_external_ip.sh @@ -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 \ No newline at end of file