#!/bin/bash
hostname
ip=`/sbin/ifconfig eth0|grep "inet addr:"|sed 's/Bcast.*$//'g |awk -F ":" {'print $2'}`
dns=`cat /etc/resolv.conf |grep -v '#'|sed 's/nameserver//'`
for i in $ip
do
echo "$i"
done
for a in $dns
do
echo "$a"
done
#!/bin/bash
hostname
ip=`/sbin/ifconfig eth0|grep "inet addr:"|sed 's/Bcast.*$//'g |awk -F ":" {'print $2'}`
dns=`cat /etc/resolv.conf |grep -v '#'|sed 's/nameserver//'`
for i in $ip
do
echo "$i"
done
for a in $dns
do
echo "$a"
done