docker-desktop/start
2016-07-13 22:45:06 -07:00

25 lines
687 B
Bash
Executable File

#!/bin/sh
trap 'kill $(jobs -p)' EXIT
useradd --create-home --groups sudo $_IMG_USERNAME
echo "$_IMG_USERNAME:$_IMG_PASSWORD" | chpasswd
su -c "mkdir -p /home/${_IMG_USERNAME}/.vnc" $_IMG_USERNAME
su -c "echo '${_IMG_PASSWORD}' | vncpasswd -f > /home/${_IMG_USERNAME}/.vnc/passwd" ${_IMG_USERNAME}
chmod 700 /home/${_IMG_USERNAME}/.vnc
chmod 600 /home/${_IMG_USERNAME}/.vnc/passwd
#echo "user=${_IMG_USERNAME}" >> /etc/supervisor/conf.d/vncd.conf
#echo 'environment=HOME="'$_IMG_USERNAME'"' >> /etc/supervisor/conf.d/vncd.conf
su -c "vncserver -geometry 1280x800 :0" $_IMG_USERNAME
if [ -x "/mnt/persist/setup.sh" ] ; then
/mnt/persist/setup.sh &
sleep 5
fi
supervisord