Skip to content

Instantly share code, notes, and snippets.

@mvrilo
Created August 21, 2015 20:26

Revisions

  1. mvrilo created this gist Aug 21, 2015.
    7 changes: 7 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/bin/bash

    if [[ "$(uname -s)" == "Darwin" ]]; then
    route get 0 | awk '/interface: /{print $NF}'
    else
    route | awk '/default /{print $NF}'
    fi