Difference between revisions of "Grep IP Gateway Script"
From MS Computech
Line 1: | Line 1: | ||
'''Script ใช้ในการ Grep IPAddress + Gateway''' | '''Script ใช้ในการ Grep IPAddress + Gateway''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre class="brush:bash"> | <pre class="brush:bash"> |
Revision as of 18:22, 2 July 2009
Script ใช้ในการ Grep IPAddress + Gateway
#!/bin/bash # IP Grep By [email protected] # 2/07/2009 EXT_I=`ip r | grep ppp0 | awk '{print$9}'` GW_I=`ip r | grep ppp0 | awk '{print$1}'` E_EXT_I=ppp0 EXT_II=`ip r | grep ppp1 | awk '{print$9}'` GW_II=`ip r | grep ppp1 | awk '{print$1}'` E_EXT_II=ppp1 echo "ppp0 IP:$EXT_I" echo "ppp0 Gateway:$GW_I" echo "ppp1 IP:$EXT_II" echo "ppp1 Gateway:$GW_II"