Skip to content

Instantly share code, notes, and snippets.

View magcks's full-sized avatar
😀

Max von Buelow magcks

😀
View GitHub Profile
@magcks
magcks / bridge_backup.sh
Last active August 29, 2015 13:59
A script that handles backups of your local bridge settings.
#!/bin/sh
FILE="$2"
if ( [ "$1" = "backup" ] && [ "$FILE" != "" ] ); then
# backup
brctl show | awk 'NR > 1 && $4 != "" { print $1 " " $4; last=$1; } NR > 1 && $2 == "" { print last " " $1; }' > "$FILE"
echo "Done"