overwrite_from_image (466B)
1 #!/bin/zsh 2 set -x 3 img=${1:-rsync://192.168.103.100/vm_archive/alpine_3.16_server_versioned/} 4 img=${img%/} 5 if ! rsync -l $img/boot/extlinux.conf; then 6 printf >&2 "Image source ${(qqq)img} does not seem to be valid" 7 exit 1 8 fi 9 mount -o remount,rw /boot || exit $? 10 rsync -aAvPx $img/boot/ /boot/ --delete --exclude ldlinux.\* || exit $? 11 rsync -aAvPx $img/ / --delete \ 12 --exclude root/.\*history \ 13 --exclude root/.local/share \ 14 --exclude var/lib/dhcpcd\ 15 || exit $?