2018-06-09 23:34:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
echo "========================================================="
|
|
|
|
echo "==!! Shinobi : The Open Source CCTV and NVR Solution !!=="
|
|
|
|
echo "=================== Mac OS Install Part 2 ==============="
|
|
|
|
echo "========================================================="
|
|
|
|
echo "Shinobi - Database Installation"
|
|
|
|
echo "(y)es or (N)o"
|
2020-01-26 02:38:34 +00:00
|
|
|
read -r mysqlagreeData
|
2018-06-09 23:34:06 +00:00
|
|
|
if [ "$mysqlagreeData" = "y" ]; then
|
|
|
|
echo "Shinobi will now use root for database installation..."
|
2019-04-03 03:47:03 +00:00
|
|
|
sudo mysql -e "source sql/user.sql" || true
|
2018-06-09 23:34:06 +00:00
|
|
|
fi
|
|
|
|
echo "============="
|
|
|
|
echo "Shinobi - Install NPM Libraries"
|
2018-08-11 18:58:15 +00:00
|
|
|
sudo npm i npm -g
|
|
|
|
sudo npm install --unsafe-perm
|
2021-05-05 20:43:03 +00:00
|
|
|
# sudo npm audit fix --unsafe-perm
|
2018-06-09 23:34:06 +00:00
|
|
|
echo "============="
|
|
|
|
echo "Shinobi - Install PM2"
|
2022-05-18 01:14:33 +00:00
|
|
|
sudo npm install pm2@latest -g
|
2018-06-09 23:34:06 +00:00
|
|
|
if [ ! -e "./conf.json" ]; then
|
|
|
|
sudo cp conf.sample.json conf.json
|
|
|
|
fi
|
|
|
|
if [ ! -e "./super.json" ]; then
|
|
|
|
echo "Default Superuser : admin@shinobi.video"
|
|
|
|
echo "Default Password : admin"
|
|
|
|
sudo cp super.sample.json super.json
|
|
|
|
fi
|
|
|
|
echo "Shinobi - Finished"
|
|
|
|
touch INSTALL/installed.txt
|
2019-04-03 03:47:03 +00:00
|
|
|
dos2unix /home/Shinobi/INSTALL/shinobi
|
|
|
|
ln -s /home/Shinobi/INSTALL/shinobi /usr/bin/shinobi
|
2018-06-09 23:34:06 +00:00
|
|
|
sudo chmod -R 755 .
|
|
|
|
echo "=====================================" > INSTALL/installed.txt
|
|
|
|
echo "======= Login Credentials =======" >> INSTALL/installed.txt
|
|
|
|
echo "|| Username : $userEmail" >> INSTALL/installed.txt
|
|
|
|
echo "|| Password : $userPasswordPlain" >> INSTALL/installed.txt
|
|
|
|
echo "|| API Key : $apiKey" >> INSTALL/installed.txt
|
|
|
|
echo "=====================================" >> INSTALL/installed.txt
|
|
|
|
echo "=====================================" >> INSTALL/installed.txt
|
|
|
|
echo "Shinobi - Start Shinobi and set to start on boot?"
|
|
|
|
echo "(y)es or (N)o"
|
2020-01-26 02:38:34 +00:00
|
|
|
read -r startShinobi
|
2018-06-09 23:34:06 +00:00
|
|
|
if [ "$startShinobi" = "y" ]; then
|
|
|
|
sudo pm2 start camera.js
|
|
|
|
sudo pm2 startup
|
|
|
|
sudo pm2 save
|
|
|
|
sudo pm2 list
|
|
|
|
fi
|
|
|
|
echo "details written to INSTALL/installed.txt"
|
|
|
|
echo "====================================="
|
|
|
|
echo "======= Login Credentials ======="
|
|
|
|
echo "|| Username : $userEmail"
|
|
|
|
echo "|| Password : $userPasswordPlain"
|
|
|
|
echo "|| API Key : $apiKey"
|
|
|
|
echo "====================================="
|
|
|
|
echo "====================================="
|