Skip to content

Instantly share code, notes, and snippets.

@jfberry
jfberry / network-status.sh
Created May 27, 2020 19:49
Work out power and network status for use pre backup
# Gather current power status
AC_POWER=`ioreg -l | grep ExternalConnected | cut -d"=" -f2 | sed -e 's/ //g'`
# Gather details about current wifi network
WIFI_NETWORK=`networksetup -getairportnetwork en0 | grep 'Current Wi-Fi Network' | cut -c 24-`
WIFI=No