diff --git a/alpine-uncloud-image.sh b/alpine-uncloud-image.sh index 4789a81..332fd2b 100755 --- a/alpine-uncloud-image.sh +++ b/alpine-uncloud-image.sh @@ -40,7 +40,7 @@ if [ "$(whoami)" != 'root' ]; then exit 1 fi -if [ $(lsb_release --short --id) != "Alpine" ]; then +if [ "$(lsb_release --short --id)" != "Alpine" ]; then echo "WARNING: this script has been designed to run on an Alpine system." >&2 echo "WARNING: Not running Alpine. Giving you 5 seconds to abort." >&2 sleep 5 diff --git a/debian-uncloud-image.sh b/debian-uncloud-image.sh index d696a72..a691920 100755 --- a/debian-uncloud-image.sh +++ b/debian-uncloud-image.sh @@ -40,7 +40,7 @@ if [ "$(whoami)" != 'root' ]; then exit 1 fi -if [ $(lsb_release --short --id) != "Debian" ]; then +if [ "$(lsb_release --short --id)" != "Debian" ]; then echo "WARNING: this script has been designed to run on a Debian system." >&2 echo "WARNING: Not running Debian. Giving you 5 seconds to abort." >&2 sleep 5 @@ -109,7 +109,7 @@ EOF run_root apt-get update # Install RDNSSD for DNS discovery from router advertisement. The service is enabled by default. -run_root apt-get install rdnssd +run_root apt-get install -y rdnssd # Initialize base services. run_root systemd-machine-id-setup diff --git a/fedora-uncloud-image.sh b/fedora-uncloud-image.sh index cecd23d..35527b2 100755 --- a/fedora-uncloud-image.sh +++ b/fedora-uncloud-image.sh @@ -16,7 +16,7 @@ RELEASE=31 ARCH=x86_64 IMAGE_PATH=fedora-uncloud-$RELEASE-$(date +%+F).img.qcow2 IMAGE_SIZE=10G -NBD_DEVICE=/dev/nbd5 +NBD_DEVICE=/dev/nbd0 cleanup() { # The order here is important. @@ -146,8 +146,8 @@ run_root dnf -y install kernel grub2 cat > /mnt/etc/dracut.conf.d/virtio-blk.conf <&2 echo "WARNING: Not running Ubuntu. Giving you 5 seconds to abort." >&2 sleep 5