-
Notifications
You must be signed in to change notification settings - Fork 3
/
startup.sh
executable file
·42 lines (33 loc) · 1.09 KB
/
startup.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
#!/bin/bash
# mkdir /var/run/sshd
# set the passwords for the user and the x11vnc session
# based on environment variables (if present), otherwise roll with
# the defaults from the Dockerfile build.
#
# I'm clearing the environmental variables used for passwords after
# setting them because the presumption is users will only access this
# container via a web browser referral from a seperately authenticated
# page, so I don't want to leak password info via these variables
#replace values in xorg.conf for virtual screen resolution by env vars set in d$
sed -i -e "s/<virtual-height>/$VIRTUAL_HEIGHT/g" /etc/X11/xorg.conf
sed -i -e "s/<virtual-width>/$VIRTUAL_WIDTH/g" /etc/X11/xorg.conf
if [ ! -z $UBUNTUPASS ]
then
/bin/echo "ubuntu:$UBUNTUPASS" | /usr/sbin/chpasswd
UBUNTUPASS=''
fi
if [ ! -z $VNCPASS ]
then
/usr/bin/x11vnc -storepasswd $VNCPASS /home/root/.vnc/passwd
VNCPASS=''
fi
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
for f in /etc/startup.aux/*.sh
do
. $f
done
chown -R ubuntu /home/ubuntu
chgrp -R ubuntu /home/ubuntu
# ;while [ 1 ]; do
/bin/bash
# done