#!/bin/bash
#sh3.sh
#PS3="Choice?"
Ping(){
echo "Please input ip / Hostname-Ping:exmple 127.0.0.1/www.baidu.com"
read temp
echo "`ping -c 3 $temp`"
choice
}
Nslookup(){
echo "Please input Hostname-DNS :exmple www.baidu.com"
read temp
echo "`nslookup $temp`"
choice
}
Netstat(){
echo "This is Netstat"
echo "`netstat`"
choice
}
route(){
echo "This is route "
#echo "`/usr/sbin/route -e`"
echo "`route -e`"
choice
}
traceroute(){
echo "Please input Hostname/ip -traceroute : exmple www.baidu.com"
read temp
#echo "`/usr/sbin/traceroute $temp`"
echo "`traceroute $temp`"
choice
}
choice(){
echo "Welcome to use the net tool program"
select choice in Ping Nslookup Netstat route traceroute Exit
do
case "$choice" in
Ping)
Ping
;;
Nslookup)
Nslookup
;;
Netstat)
Netstat
;;
route)
route
;;
traceroute)
traceroute
;;
Exit)
break;;
esac
done
}
choice
shell -select
最新推荐文章于 2021-11-02 14:11:58 发布