From 265fb788251e6cc553d0d7006cadb6deaeaef9fa Mon Sep 17 00:00:00 2001 From: Jordan Geoghegan Date: Sun, 26 Jan 2020 03:21:13 +0000 Subject: [PATCH] ubuntu.sh : Use double quotes to prevent globbing and word splitting. Use "read -r" for correctness --- INSTALL/ubuntu.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/INSTALL/ubuntu.sh b/INSTALL/ubuntu.sh index d9cbe831..de777a75 100644 --- a/INSTALL/ubuntu.sh +++ b/INSTALL/ubuntu.sh @@ -73,11 +73,11 @@ fi echo "=============" echo "Shinobi - Do you want to Install MariaDB? Choose No if you already have it." echo "(y)es or (N)o" -read mysqlagree +read -r mysqlagree if [ "$mysqlagree" = "y" ] || [ "$mysqlagree" = "Y" ]; then echo "Shinobi - Installing MariaDB" echo "Password for root SQL user, If you are installing SQL now then you may put anything:" - read sqlpass + read -r sqlpass echo "mariadb-server mariadb-server/root_password password $sqlpass" | debconf-set-selections echo "mariadb-server mariadb-server/root_password_again password $sqlpass" | debconf-set-selections sudo apt install mariadb-server -y @@ -86,19 +86,19 @@ fi echo "=============" echo "Shinobi - Database Installation" echo "(y)es or (N)o" -read mysqlagreeData +read -r mysqlagreeData if [ "$mysqlagreeData" = "y" ] || [ "$mysqlagreeData" = "Y" ]; then if [ "$mysqlagree" = "y" ] || [ "$mysqlagree" = "Y" ]; then sqluser="root" fi if [ ! "$mysqlagree" = "y" ]; then echo "What is your SQL Username?" - read sqluser + read -r sqluser echo "What is your SQL Password?" - read sqlpass + read -r sqlpass fi - sudo mysql -u $sqluser -p$sqlpass -e "source sql/user.sql" || true - sudo mysql -u $sqluser -p$sqlpass -e "source sql/framework.sql" || true + 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" @@ -115,7 +115,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