-
Notifications
You must be signed in to change notification settings - Fork 1
/
kiosk
executable file
·45 lines (43 loc) · 1.35 KB
/
kiosk
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
#!/bin/bash
# Script is used to ssh into a running unit and force restart a running chromium browser in kiosk mode.
# Example: ssh mydisplay.local 'kiosk'
URL="http://ipaddress/"
FILE="file.html"
if [[ -e "/etc/os-release" ]]; then
if [[ `grep -w "ID=debian" "/etc/os-release"` ]]; then
:;
else
echo ""
echo -e "This script requires Debian."
exit 0
fi
else
echo ""
echo "This script requires Debian."
exit 0
fi
if [[ `command -v chromium` ]]; then :; else sudo apt update; sudo apt upgrade -y; sudo apt install -y chromium; fi
if [[ `command -v chromium` ]]; then
echo -en "Killing kiosk "
if [[ `command -v killall` ]]; then
killall chromium; killall chromium > /dev/null 2>&1
else
pkill -o chromium; pkill -o chromium > /dev/null 2>&1
fi
sleep 1.25
if [[ -e "${HOME}/.cache/chromium" ]] || [[ -d "${HOME}/.cache/chromium" ]]; then
rm -fdr ${HOME}/.cache/chromium
fi
if [[ -e "${HOME}/.config/chromium" ]] || [[ -d "${HOME}/.config/chromium" ]]; then
rm -fdr ${HOME}/.config/chromium
fi
echo -e "[done]"
echo -en "Starting kiosk "
DISPLAY=:0 chromium --noerrdialogs --incognito --kiosk --force-device-scale-factor=1 --disk-cache-dir=/tmp/null --enable-features=WebUIDarkMode --force-dark-mode ${URL}${FILE} > /dev/null 2>&1 &
echo -e "[done]"
else
echo ""
echo -e "You do not have Chromium installed."
exit 0
fi
exit 0