-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·41 lines (34 loc) · 975 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·41 lines (34 loc) · 975 Bytes
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
#!/bin/sh
INTERFACE="${INTERFACE:-0.0.0.0}"
DEPTH="${DEPTH:-32}"
GEOMETRY="${GEOMETRY:-1700x800}"
VNC_PASSWORD_FILE="${VNC_PASSWORD_FILE:-/tmp/vncpasswd}"
if [ -f "$VNC_PASSWORD_FILE" ]; then
printf '%s\n%s\n%s\n' \
"#############################" \
"Using existing vncpasswd file" \
"#############################"
else
# the password file does not exist, so we generate a session-specific
# password (and print it to the console/logs)
printf '%s\n%s' \
"##########################" \
"Session password: "
{ openssl rand -hex 4 \
| tee /dev/stderr \
| tigervncpasswd -f >"$VNC_PASSWORD_FILE"; } 2>&1
printf '%s\n' \
"##########################"
fi
touch "$HOME/.Xauthority"
dbus-uuidgen --ensure
exec vncserver \
:0 \
-depth "$DEPTH" \
-geometry "$GEOMETRY" \
-fg \
-PasswordFile "$VNC_PASSWORD_FILE" \
-xstartup "mate-session" \
-interface "$INTERFACE" \
-localhost no \
"$@"