From 024fcdd35cbdf23f5d94d3ac53865c6789affdf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Fri, 29 Mar 2019 19:51:23 +1100 Subject: [PATCH] improve update-boot.sh --- update-boot.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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