Fix various shellchecks errors

This commit is contained in:
fnux 2020-01-26 11:43:57 +01:00
parent 3ca0c38d15
commit a55fc96714
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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 <<EOF
add_drivers="virtio-blk"
EOF
kernel_version=$(ls /mnt/boot | grep "vmlinuz.*.$ARCH" | cut -d- -f2-)
run_root dracut --force --kver $kernel_version
kernel_version=$(find /mnt/boot -name "vmlinuz-*.$ARCH" | cut -d- -f2-)
run_root dracut --force --kver "$kernel_version"
# Configure grub2.
run_root grub2-install --target=i386-pc "${NBD_DEVICE}"

View File

@ -40,7 +40,7 @@ if [ "$(whoami)" != 'root' ]; then
exit 1
fi
if [ $(lsb_release --short --id) != "Ubuntu" ]; then
if [ "$(lsb_release --short --id)" != "Ubuntu" ]; then
echo "WARNING: this script has been designed to run on an Ubuntu system." >&2
echo "WARNING: Not running Ubuntu. Giving you 5 seconds to abort." >&2
sleep 5