From d4f7445e2667ecaf40ca5ed743ceeaa68ac09888 Mon Sep 17 00:00:00 2001 From: "DESKTOP-F8P3LSJ\\augusto\\dev" Date: Tue, 22 Jul 2025 16:07:59 -0400 Subject: [PATCH] Add menuIP.sh script to create an interactive menu for checking external IP, listing directory contents, and pinging Google. Enhances user experience with clear prompts and options. --- menuIP.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 menuIP.sh diff --git a/menuIP.sh b/menuIP.sh new file mode 100644 index 0000000..b88549f --- /dev/null +++ b/menuIP.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