-
Notifications
You must be signed in to change notification settings - Fork 0
/
installDivera.sh
52 lines (39 loc) · 992 Bytes
/
installDivera.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
#!/bin/bash
# Get user input
echo "Enter Dashboard ID:"
read dashboardID
echo "Enter autologin key:"
read loginKey
URL="https://app.divera247.com/spa-next/dashboard/$dashboardID?autologin=$loginKey&theme=dark"
# Check URL
echo
echo "Check URL:"
echo $URL
# Leave program when user does not verify URL
read -p "Is the URL correct? [y/n]: " yesNo
if [ $yesNo != "y" ]
then
echo "Leaving installation script!"
exit
fi
# Create divera directory
sudo mkdir -p /etc/divera
# Create startup script file
sudo touch /etc/divera/diveraStart.sh
# Create startup script
cat <<EOT > /etc/divera/diveraStart.sh
#!/bin/bash
URL="$URL"
xset s off
xset s noblank
xset -dpms
chromium-browser --noerrdialogs --kiosk --incognito \$URL &>/dev/null &
EOT
# File must be executable
chmod +x /etc/divera/diveraStart.sh
# Write autostart file
cat <<EOT > /etc/xdg/lxsession/LXDE-pi/autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@sh /etc/divera/diveraStart.sh
EOT