Difference between revisions of "Grep IP Gateway Script"
From MS Computech
Line 1: | Line 1: | ||
'''Script ใช้ในการ Grep IPAddress + Gateway''' | '''Script ใช้ในการ Grep IPAddress + Gateway''' | ||
− | <source lang=bash> | + | <source lang="bash" line start="0"> |
#!/bin/bash | #!/bin/bash | ||
# IP Grep By [email protected] | # IP Grep By [email protected] |
Revision as of 18:16, 2 July 2009
Script ใช้ในการ Grep IPAddress + Gateway
<source lang="bash" line start="0">
- !/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" </source>