-
Notifications
You must be signed in to change notification settings - Fork 21
/
osmc_installer.sh
executable file
·63 lines (52 loc) · 1.39 KB
/
osmc_installer.sh
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
62
63
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Futtasd root modban. Ird be: sudo su"
exit
fi
echo "DIGIOnline v2 servlet telepito indul...";
sleep 2;
apt-get update;
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get install -y nodejs git
curl -sL https://npmjs.org/install.sh
git clone https://github.com/szabbenjamin/digionline | sudo -E bash -
cd digionline
echo "#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
cd /home/osmc/digionline
npm start" > digionline.sh
chmod +x digionline.sh
npm install
cp config.sample.json config.json
touch epg.xml
echo "Kerlek add meg bejelentkezesi adataidat... (Egy pillanat es nyilik a szerkeszto. Mentes: CTRL+X)"
sleep 5
nano config.json
mkdir log
echo "[Unit]
Description=digionline servlet app
[Service]
ExecStart=/home/osmc/digionline/digionline.sh
Restart=always
User=root
Group=root
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/home/osmc/digionline
[Install]
WantedBy=multi-user.target" > digionline.service
tsc main.ts
cp digionline.service /etc/systemd/system
systemctl start digionline
systemctl enable digionline
apt-get update
apt-get upgrade
echo "A telepítő lefutott, újraindítás szükséges";
read -p "Akarod most újraindítani a rendszert? [I/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Ii]$ ]]
then
shutdown -r now
else
echo "Újraindítás később"
fi