diff --git a/update-boot.sh b/update-boot.sh index 000a5be..ec46f8b 100755 --- a/update-boot.sh +++ b/update-boot.sh @@ -5,8 +5,15 @@ dls_url="$1" set -ex mount -o remount,rw /boot -rm -fr /boot/previous ||true -mv /boot/current /boot/previous + +if [ -e /boot/previous ]; then + rm -fr /boot/previous +fi + +if [ -e /boot/current ]; then + mv /boot/current /boot/previous +fi + curl $dls_url/me/boot.tar |tar xv -C /boot sync