Divya bin define functions retrieve system informationget hostname addr
hostname -f
}
lsb_release -d | awk '{print $2, $3}'
}
free -h | awk '/Mem/ {print $2}'
}
if command -v lpstat >/dev/null 2>&1; then
lpstat -p | awk '{print $2}'
# Parse command line options
while getopts "hnioscdp" opt; do
echo " -h Show this help message"
echo " -n Show system name with domain name"
echo " -d Show available disk space on physical drives"
echo " -p Show list of printers configured"
;;
i) # Show IP addresses by interface
;;
s) # Show CPU description
;;
d) # Show available disk space on physical drives
;;
\?) # Invalid option
done
# If no options are provided, display all system information
echo "IP addresses by interface:"
get_ip_addresses
echo "CPU description:"
get_cpu_info
echo "Available disk space on physical drives:"
get_disk_space
fi