forked from Jodel/dashboard-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·65 lines (52 loc) · 1.22 KB
/
run
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
64
65
#!/bin/bash
# set -euo pipefail
set -x
URL=${URL:-http://jodel-app.com}
WALLPAPER=/etc/wallpaper.png
CUSTOM_WALLPAPER=/data/custom-wallpaper.png
export PASS=${PASS:=root}
echo "root:$PASS" | chpasswd
rm -rf /data/tmp/*
if [ -n "$REMOTE_HOST" ]; then
cat <<EOF > /etc/openvpn.conf
client
nobind
remote-random
remote $REMOTE_HOST $REMOTE_PORT
proto tcp
mute 5
dev tun
<ca>
$( echo -e "$CERT" )
</ca>
auth-user-pass /etc/openvpn.credentials
EOF
( umask 0077; echo -e "${VPN_USER}\n${VPN_PASS}" > /etc/openvpn.credentials )
openvpn --config /etc/openvpn.conf &
fi
if ! [ -e "/etc/dropbear/dropbear_ecdsa_host_key" ]; then
dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key
fi
dropbear -E -F &
DB_PID=$!
Xorg &
X_PID=$!
echo "Waiting for X to be ready"
export DISPLAY=:0
# Download custom wallpaper
if [ -n "$WALLPAPER_URL" ]; then
if [ -e "$CUSTOM_WALLPAPER" ]; then
WALLPAPER=$CUSTOM_WALLPAPER
else
curl -o "$CUSTOM_WALLPAPER" "$WALLPAPER_URL"
fi
fi
# Setting wallpaper and polling X in one!
while ! feh --bg-scale $WALLPAPER; do sleep 1; done
matchbox-window-manager -use_cursor no &
while ! curl -sf -o /dev/null "$URL"; do sleep 1; done
xset -dpms
xset s off
xset s noblank
iceweasel "$URL"
sleep infinity