Difference between revisions of "Grep IP Gateway Script"
From MS Computech
(Created page with ''''Script ใช้ในการ Grep IPAddress + Gateway''' <source lang=bash> #!/bin/bash # IP GREP # 2/07/2009 EXT_IF_I=`ip r | grep ppp0 | awk '{print$9}'` GW_I=`ip r | g…') |
(No difference)
|
Revision as of 18:10, 2 July 2009
Script ใช้ในการ Grep IPAddress + Gateway
<source lang=bash>
- !/bin/bash
- IP GREP
- 2/07/2009
EXT_IF_I=`ip r | grep ppp0 | awk '{print$9}'` GW_I=`ip r | grep ppp0 | awk '{print$1}'`
- ETH_EXT_I=ppp0
EXT_IF_II=`ip r | grep ppp1 | awk '{print$9}'` GW_II=`ip r | grep ppp1 | awk '{print$1}'`
- ETH_EXT_II=ppp1
echo "ppp0 IP:$EXT_IF_I" echo "ppp0 Gateway:$GW_I" echo "ppp1 IP:$EXT_IF_II" echo "ppp1 Gateway:$GW_II" </source>