forked from kercre123/0.11-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·61 lines (51 loc) · 1.74 KB
/
install.sh
File metadata and controls
executable file
·61 lines (51 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set -e
if [[ -f main.go ]]; then
echo "This script is only meant to be run in a server deployment."
exit 0
fi
if [[ $1 == "-u" ]]; then
if [[ $2 == "" ]]; then
echo "You must also provide the location of the current install."
exit 0
fi
ORIGDIR="$(pwd)"
cd $2
if [[ ! -f 011-cloud ]]; then
echo "This is the wrong directory."
fi
sudo systemctl stop 011-cloud
sync
sudo rm -rf webroot install.sh 011-cloud 011-cloud.sh stttest.pcm intent-data weather-map.json model vosk opus
sudo cp -r ${ORIGDIR}/webroot .
sudo cp ${ORIGDIR}/011-cloud .
sudo cp ${ORIGDIR}/install.sh .
sudo cp ${ORIGDIR}/011-cloud.sh .
sudo cp ${ORIGDIR}/stttest.pcm .
sudo cp -r ${ORIGDIR}/intent-data .
sudo cp ${ORIGDIR}/weather-map.json .
sudo cp -r ${ORIGDIR}/model .
sudo cp -r ${ORIGDIR}/vosk .
sudo cp -r ${ORIGDIR}/opus .
sync
sudo systemctl start 011-cloud
fi
echo "[Unit]" >011-cloud.service
echo "Description=Vector Cloud for 0.11" >>011-cloud.service
echo "StartLimitIntervalSec=500" >>011-cloud.service
echo "StartLimitBurst=5" >>011-cloud.service
echo >>011-cloud.service
echo "[Service]" >>011-cloud.service
echo "Type=simple" >>011-cloud.service
echo "Restart=on-failure" >>011-cloud.service
echo "RestartSec=5s" >>011-cloud.service
echo "WorkingDirectory=$(readlink -f ./)" >>011-cloud.service
echo "ExecStart=$(readlink -f ./011-cloud.sh)" >>011-cloud.service
echo >>011-cloud.service
echo "[Install]" >>011-cloud.service
echo "WantedBy=multi-user.target" >>011-cloud.service
cat 011-cloud.service
echo
sudo mv 011-cloud.service /lib/systemd/system/
sudo systemctl daemon-reload
echo "Daemon installed. Create a source.sh file with your desired settings and run systemctl start 011-cloud."