]> code.delx.au - monosys/blob - hacks/backup-openwrt
backup-openwrt
[monosys] / hacks / backup-openwrt
1 #!/bin/bash
2
3 BACKUP_HOSTS="$(awk '/^Host.*openwrt/ {print $2}' < ~/.ssh/config)"
4
5 cd ~/backup-openwrt/
6
7 for host in $BACKUP_HOSTS; do
8 file="${host}.backup.tar.gz"
9 ssh "$host" sysupgrade -b - > "${file}.new" && mv "${file}.new" "${file}"
10 done
11