modules/microvm-host: improve update-microvm behaviour
This commit is contained in:
parent
10bb8eb364
commit
afc7a33eb5
|
@ -90,17 +90,26 @@
|
|||
if [ -e booted ]; then
|
||||
nix store diff-closures $(readlink booted) $NEW
|
||||
else
|
||||
echo "NOT BOOTED?"
|
||||
echo "NOT BOOTED? Run:"
|
||||
echo systemctl start microvm@$NAME
|
||||
fi
|
||||
if [ "$(readlink current)" != $NEW ]; then
|
||||
|
||||
CHANGED=no
|
||||
if ! [ -e current ]; then
|
||||
ln -s $NEW current
|
||||
CHANGED=yes
|
||||
elif [ "$(readlink current)" != $NEW ]; then
|
||||
rm -f old
|
||||
mv current old
|
||||
ln -s $NEW current
|
||||
CHANGED=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
echo Run at your own peril:
|
||||
echo systemctl restart microvm@$NAME
|
||||
if [ "$CHANGED" = "yes" ]; then
|
||||
echo Run at your own peril:
|
||||
echo systemctl restart microvm@$NAME
|
||||
fi
|
||||
echo
|
||||
done
|
||||
''
|
||||
|
|
Loading…
Reference in New Issue