commit 9a5b89f9a3f7d86e0e0614aba90741568e910148 parent 23ad1380c7f6364a4a4ca5e612d63e630f42b9e6 Author: Jan Pobrislo <ccx@webprojekty.cz> Date: Tue, 26 Jul 2022 16:43:01 +0200 Add script for self-overwriting of system image from rsync. Diffstat:
A | overwrite_from_image | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/overwrite_from_image b/overwrite_from_image @@ -0,0 +1,11 @@ +#!/bin/zsh +set -x +img=${1:-rsync://192.168.103.100/vm_archive/alpine_3.16_server_versioned/} +img=${img%/} +if ! rsync -l $img/boot/extlinux.conf; then + printf >&2 "Image source ${(qqq)img} does not seem to be valid" + exit 1 +fi +mount -o remount,rw /boot || exit $? +rsync -aAvPx $img/boot/ /boot/ --delete --exclude ldlinux.\* || exit $? +rsync -aAvPx $img/ / --delete --exclude /root/.\* || exit $?