Files

44 lines
1.6 KiB
Bash

#!/bin/bash
# DYNR Module: Network Stance v2.3.6
run_network() {
BLUE='\033[38;5;45m'; PURPLE='\033[38;5;127m'; GOLD='\033[38;5;178m'; RED='\033[38;5;196m'; NC='\033[0m'
# --- Dynamic Dependency Check ---
if ! command -v ip &> /dev/null; then
echo -e "${RED}⚠️ The 'iproute2' package is required for Network Stance.${NC}"
read -p "Manifest this tool now? (y/n): " choice
if [[ "$choice" == "y" ]]; then
sudo apt update -qq && sudo apt install -y -qq iproute2
else
echo -e "${RED}Stance aborted.${NC}"
dynr; return
fi
fi
clear
echo -e "${PURPLE}=================================================${NC}"
echo -e "${BLUE} 🐉 DYNASTY REVOLUTION: NETWORK STANCE 🐉 ${NC}"
echo -e "${PURPLE}=================================================${NC}"
# Diagnostics
PUB_IP=$(curl -s https://ifconfig.me || echo "Offline")
LOC_IP=$(hostname -I | awk '{print $1}')
GATEWAY=$(ip route | grep default | awk '{print $3}')
echo -e "${GOLD}LOCAL IP: ${NC}$LOC_IP"
echo -e "${GOLD}PUBLIC IP: ${NC}$PUB_IP"
echo -e "${GOLD}GATEWAY: ${NC}$GATEWAY"
echo -e "${PURPLE}-------------------------------------------------${NC}"
echo -e "${GOLD}DNS CONNECTIVITY:${NC}"
if ping -c 1 8.8.8.8 &>/dev/null; then
echo -e " ${BLUE}${NC} Internet Reachable (Google DNS)"
else
echo -e " ${RED}${NC} Internet Unreachable"
fi
echo -e "${PURPLE}=================================================${NC}"
read -p "Press Enter to return..." < /dev/tty
dynr
}