Refactor menu.sh
This commit is contained in:
@ -7,4 +7,16 @@ define_colors() {
|
||||
yellow='\033[0;33m'
|
||||
LPurple='\033[1;35m'
|
||||
NC='\033[0m' # No Color
|
||||
}
|
||||
|
||||
# Function to get system information
|
||||
get_system_info() {
|
||||
OS=$(lsb_release -d | awk -F'\t' '{print $2}')
|
||||
ARCH=$(uname -m)
|
||||
# Fetching detailed IP information in JSON format
|
||||
IP_API_DATA=$(curl -s https://ipapi.co/json/ -4)
|
||||
ISP=$(echo "$IP_API_DATA" | jq -r '.org')
|
||||
IP=$(echo "$IP_API_DATA" | jq -r '.ip')
|
||||
CPU=$(top -bn1 | grep "Cpu(s)" | awk '{print $2 + $4 "%"}')
|
||||
RAM=$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')
|
||||
}
|
||||
Reference in New Issue
Block a user