opensuse.sh : use double quotes to prevent globbing and word splitting. use "read -r"

revert-b25c0d81
Jordan Geoghegan 2020-01-26 03:01:53 +00:00
parent 103c543a0e
commit bcd3245976
1 changed files with 11 additions and 11 deletions

View File

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