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