Always quote echo strings

This commit is contained in:
Andrew Scheller 2018-01-22 01:37:05 +00:00
parent b11de9a8ee
commit b787dd4e66
1 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ if [ "$should_skip_autoexpand" = false ]; then
mount $loopback $mountdir mount $loopback $mountdir
if [ $(md5sum $mountdir/etc/rc.local | cut -d ' ' -f 1) != "0542054e9ff2d2e0507ea1ffe7d4fc87" ]; then if [ $(md5sum $mountdir/etc/rc.local | cut -d ' ' -f 1) != "0542054e9ff2d2e0507ea1ffe7d4fc87" ]; then
echo Creating new /etc/rc.local echo "Creating new /etc/rc.local"
mv $mountdir/etc/rc.local $mountdir/etc/rc.local.bak mv $mountdir/etc/rc.local $mountdir/etc/rc.local.bak
#####Do not touch the following lines##### #####Do not touch the following lines#####
cat <<\EOF1 > $mountdir/etc/rc.local cat <<\EOF1 > $mountdir/etc/rc.local
@ -127,14 +127,14 @@ EOF1
fi fi
umount $mountdir umount $mountdir
else else
echo Skipping autoexpanding process... echo "Skipping autoexpanding process..."
fi fi
#Make sure filesystem is ok #Make sure filesystem is ok
e2fsck -p -f $loopback e2fsck -p -f $loopback
minsize=$(resize2fs -P $loopback | cut -d ':' -f 2 | tr -d ' ' | tr -d '\n') minsize=$(resize2fs -P $loopback | cut -d ':' -f 2 | tr -d ' ' | tr -d '\n')
if [[ $currentsize -eq $minsize ]]; then if [[ $currentsize -eq $minsize ]]; then
echo ERROR: Image already shrunk to smallest size echo "ERROR: Image already shrunk to smallest size"
exit -6 exit -6
fi fi
@ -150,7 +150,7 @@ fi
#Shrink filesystem #Shrink filesystem
resize2fs -p $loopback $minsize resize2fs -p $loopback $minsize
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo ERROR: resize2fs failed... echo "ERROR: resize2fs failed..."
mount $loopback $mountdir mount $loopback $mountdir
mv $mountdir/etc/rc.local.bak $mountdir/etc/rc.local mv $mountdir/etc/rc.local.bak $mountdir/etc/rc.local
umount $mountdir umount $mountdir