Get Some Free Products at your Door Step. Just feed ur Address in dis Link...!!

Tuesday, September 8, 2015

Networking information Shell script (Linux)

input=$1

if [ $input = "ip" ]
    then
        ifconfig|grep -w inet

elif [ $input = "ip6" ]
    then
        ifconfig|grep inet6

elif [ $input = "mac" ]
    then
        ifconfig|grep HWaddr
elif [ $input = "broadcast" ]
    then
        ifconfig|grep broadcast
elif [ $input = "mask" ]
    then
        ifconfig|grep mask

elif [ $input = "data" ]
    then
        ifconfig|grep bytes

elif [ $input = "help" ]
    then
    echo "ip"
    echo "ip6"
    echo "mac"
    echo "broadcast"
    echo "mask"
    echo "data"
    echo "help"
else
        echo "others"
fi