UNPKG

985 Bapplication/x-shView Raw
1#!/bin/bash
2distro=$1
3if [ -z ${distro+x} ]; then
4 distro='master'
5fi
6rm -rf $distro master_temp
7wget https://github.com/ShinobiCCTV/Shinobi/tarball/$distro
8mkdir master_temp
9tar -xzf $distro -C master_temp --strip-components=1
10pm2 stop camera.js
11pm2 stop cron.js
12pm2 kill
13mv master_temp/UPDATE.sh UPDATE.sh
14chmod +x UPDATE.sh
15sed -i 's/\r//' UPDATE.sh
16mv master_temp/languages languages
17mv master_temp/definitions definitions
18mv master_temp/web web
19mv master_temp/LICENSE LICENSE
20mv master_temp/COPYING COPYING
21mv master_temp/package.json package.json
22mv master_temp/camera.js camera.js
23mv master_temp/cron.js cron.js
24mv master_temp/plugins/motion/shinobi-motion.js plugins/motion/shinobi-motion.js
25mv master_temp/plugins/opencv/shinobi-opencv.js plugins/motion/shinobi-opencv.js
26npm install
27rm -rf $distro master_temp
28pm2 start camera.js
29pm2 start cron.js
30if [ ! -f plugins/motion/conf.json ]; then
31 pm2 start plugins/motion/shinobi-motion.js
32fi
\No newline at end of file