From: James Bunton Date: Mon, 14 Jun 2021 04:59:44 +0000 (+1000) Subject: backup-openwrt X-Git-Url: https://code.delx.au/monosys/commitdiff_plain/90e01d05e0202e38902e21fa11850d52cd502f58 backup-openwrt --- diff --git a/hacks/backup-openwrt b/hacks/backup-openwrt new file mode 100755 index 0000000..59b8640 --- /dev/null +++ b/hacks/backup-openwrt @@ -0,0 +1,11 @@ +#!/bin/bash + +BACKUP_HOSTS="$(awk '/^Host.*openwrt/ {print $2}' < ~/.ssh/config)" + +cd ~/backup-openwrt/ + +for host in $BACKUP_HOSTS; do + file="${host}.backup.tar.gz" + ssh "$host" sysupgrade -b - > "${file}.new" && mv "${file}.new" "${file}" +done +