From bcd32459761c23d70b79decaa9a02274cd4e2143 Mon Sep 17 00:00:00 2001 From: Jordan Geoghegan Date: Sun, 26 Jan 2020 03:01:53 +0000 Subject: [PATCH] opensuse.sh : use double quotes to prevent globbing and word splitting. use "read -r" --- INSTALL/opensuse.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/INSTALL/opensuse.sh b/INSTALL/opensuse.sh index e33ef2e4..19dae61d 100644 --- a/INSTALL/opensuse.sh +++ b/INSTALL/opensuse.sh @@ -17,7 +17,7 @@ if [ ! -e "./super.json" ]; then echo "if you would like to limit accessibility of an" echo "account for business scenarios." echo "(y)es or (N)o" - read createSuperJson + read -r createSuperJson if [ "$createSuperJson" = "y" ] || [ "$createSuperJson" = "Y" ]; then echo "Default Superuser : admin@shinobi.video" echo "Default Password : admin" @@ -32,7 +32,7 @@ echo "=============" echo "Shinobi - Do you want to Install Node.js?" echo "(y)es or (N)o" NODEJSINSTALL=0 -read nodejsinstall +read -r nodejsinstall if [ "$nodejsinstall" = "y" ] || [ "$nodejsinstall" = "Y" ]; then sudo zypper install -y nodejs11 NODEJSINSTALL=1 @@ -40,14 +40,14 @@ fi echo "=============" echo "Shinobi - Do you want to Install FFMPEG?" echo "(y)es or (N)o" -read ffmpeginstall +read -r ffmpeginstall if [ "$ffmpeginstall" = "y" ] || [ "$ffmpeginstall" = "Y" ]; then # Without nodejs8 package we can't use npm command if [ "$NODEJSINSTALL" -eq "1" ]; then echo "Shinobi - Do you want to Install FFMPEG with 'zypper --version' or download a static version provided with npm 'npm --version'?" echo "(z)ypper or (N)pm" echo "Press [ENTER] for default (npm)" - read ffmpegstaticinstall + read -r ffmpegstaticinstall if [ "$ffmpegstaticinstall" = "z" ] || [ "$ffmpegstaticinstall" = "Z" ]; then # Install ffmpeg and ffmpeg-devel sudo zypper install -y ffmpeg ffmpeg-devel @@ -61,7 +61,7 @@ fi echo "=============" echo "Shinobi - Do you want to Install MariaDB?" echo "(y)es or (N)o" -read mysqlagree +read -r mysqlagree if [ "$mysqlagree" = "y" ] || [ "$mysqlagree" = "Y" ]; then sudo zypper install -y mariadb #Start mysql and enable on boot @@ -73,14 +73,14 @@ fi echo "=============" echo "Shinobi - Database Installation" echo "(y)es or (N)o" -read mysqlagreeData +read -r mysqlagreeData if [ "$mysqlagreeData" = "y" ] || [ "$mysqlagreeData" = "Y" ]; then echo "What is your SQL Username?" - read sqluser + read -r sqluser echo "What is your SQL Password?" - read sqlpass - sudo mysql -u $sqluser -p$sqlpass -e "source sql/user.sql" || true - sudo mysql -u $sqluser -p$sqlpass -e "source sql/framework.sql" || true + read -r sqlpass + sudo mysql -u "$sqluser" -p"$sqlpass" -e "source sql/user.sql" || true + sudo mysql -u "$sqluser" -p"$sqlpass" -e "source sql/framework.sql" || true fi echo "=============" echo "Shinobi - Install NPM Libraries" @@ -97,7 +97,7 @@ dos2unix /home/Shinobi/INSTALL/shinobi ln -s /home/Shinobi/INSTALL/shinobi /usr/bin/shinobi echo "Shinobi - Start Shinobi and set to start on boot?" echo "(y)es or (N)o" -read startShinobi +read -r startShinobi if [ "$startShinobi" = "y" ] || [ "$startShinobi" = "Y" ]; then sudo pm2 start camera.js sudo pm2 start cron.js