Difference between revisions of "Capture gateway IP using shell script"

From Notes_Wiki
(Created page with "<yambe:breadcrumb>Useful_bash_shell_scripts|Useful bash shell scripts</yambe:breadcrumb> =Capture gateway IP using shell script= To capture gateway IP using shell-script use:...")
(No difference)

Revision as of 11:24, 15 December 2015

<yambe:breadcrumb>Useful_bash_shell_scripts|Useful bash shell scripts</yambe:breadcrumb>

Capture gateway IP using shell script

To capture gateway IP using shell-script use:

IP=$(/sbin/ip route | awk '/default/ { print $3 }')