-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathrun
executable file
·54 lines (42 loc) · 986 Bytes
/
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
#!/bin/bash
# set -euo pipefail
set -x
URL=${URL:-http://jodel-app.com}
export PASS=${PASS:=root}
echo "root:$PASS" | chpasswd
rm -rf /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
# Setting wallpaper and polling X in one!
while ! feh --bg-scale /etc/wallpaper.png; 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