Fix shellcheck failures in bootstrap.sh and create_block.sh

k3s-v1.15.3
aaa 2019-03-20 17:37:50 -04:00
parent b1829dff0b
commit 46799b6dd4
3 changed files with 9 additions and 11 deletions

View File

@ -107,8 +107,6 @@
./test/images/volume/gluster/run_gluster.sh
./test/images/volume/iscsi/create_block.sh
./test/images/volume/nfs/run_nfs.sh
./test/images/volume/rbd/bootstrap.sh
./test/images/volume/rbd/create_block.sh
./third_party/forked/shell2junit/sh2ju.sh
./third_party/intemp/intemp.sh
./third_party/multiarch/qemu-user-static/register/qemu-binfmt-conf.sh

View File

@ -25,10 +25,10 @@
# Create /etc/ceph/ceph.conf
sh ./ceph.conf.sh `hostname -i`
sh ./ceph.conf.sh "$(hostname -i)"
# Configure and start ceph-mon
sh ./mon.sh `hostname -i`
sh ./mon.sh "$(hostname -i)"
# Configure and start 2x ceph-osd
mkdir -p /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-1
@ -51,7 +51,7 @@ ceph fs new cephfs cephfs_metadata cephfs_data
# It takes a while until the volume created above is mountable,
# 1 second is usually enough, but try indefinetily.
sleep 1
while ! ceph-fuse -m `hostname -i`:6789 /mnt; do
while ! ceph-fuse -m "$(hostname -i):6789" /mnt; do
echo "Waiting for cephfs to be up"
sleep 1
done

View File

@ -20,7 +20,7 @@
# Exit on the first error.
set -e
MNTDIR=`mktemp -d`
MNTDIR="$(mktemp -d)"
cleanup()
{
@ -28,8 +28,8 @@ cleanup()
RET=$?
# Silently remove everything and ignore errors
set +e
/bin/umount $MNTDIR 2>/dev/null
/bin/rmdir $MNTDIR 2>/dev/null
/bin/umount "$MNTDIR" 2>/dev/null
/bin/rmdir "$MNTDIR" 2>/dev/null
/bin/rm block 2>/dev/null
exit $RET
}
@ -42,9 +42,9 @@ dd if=/dev/zero of=block seek=120 count=1 bs=1M
mkfs.ext2 block
# Add index.html to it
mount -o loop block $MNTDIR
echo "Hello from RBD" > $MNTDIR/index.html
umount $MNTDIR
mount -o loop block "$MNTDIR"
echo "Hello from RBD" > "$MNTDIR/index.html"
umount "$MNTDIR"
rm block.tar.gz 2>/dev/null || :
tar cfz block.tar.gz block