#!/bin/bash
while true; do
echo "Type the command, followed by [ENTER]:"
read mast
echo -n $mast
case "$mast" in
'Ping-DNS' ) ping -c2 174.24.254.55
;;
'Ping-XP' ) ping -c2 172.24.254.55
;;
'Check-Hostname') hostname -f
;;
'Check-System-log') tail -n4 /var/log/message
;;
'Check-maillog') tail -n4 /var/log/maillog
;;
'Check-open-portS') netstat -ntulp
;;
'Check-ip') ifconfig | grep "inet addr"
;;
'Change-network-settings' ) vi /etc/sysconfig/network-scripts/ifcfg-eth0
;;
'Change-DNS') vi /etc/resolve.conf
;;
'quit') exit 1
;;
*) echo "Usage:"
echo $(basename $0) "[Ping-DNS] | [Ping-XP] | [Check-Hostname] | [Check-System-log] |"
echo " [Check-maillog] | [Check-open-ports] | [Check-ip] | [Change-DNS] |"
echo " [Change-network-settings | [quit]"
;;
esac
|