Skip to content

Commit 87a82cc

Browse files
authored
store network-status-mac
simple ad-hoc script for tmux @ macos
1 parent f203d86 commit 87a82cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

network-status-mac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#/usr/bin/env bash
2+
3+
current_if=$(scutil --dns|grep if_index|cut -d' ' -f 6|sed 's/[()]//g')
4+
if_info=$(networksetup -listnetworkserviceorder | grep ${current_if})
5+
if_name=$(echo ${if_info} | sed 's/.*Hardware Port: \(.*\),.*/\1/')
6+
[ -z ${if_name} ] && echo '-' || echo ${if_name}

0 commit comments

Comments
 (0)