Skip to content

Commit

Permalink
Change how password is supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandandai committed May 15, 2024
1 parent 5091071 commit c179678
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion execute-on-vnc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NEW_DISPLAY=42
DONE="no"

mkdir -p ~/.vnc
echo "password" > ~/.vnc/passwd
PASSWORD=$(openssl rand -base64 12)

while [ "$DONE" == "no" ]
do
Expand All @@ -24,6 +24,8 @@ OLD_DISPLAY=${DISPLAY}
vncserver ":${NEW_DISPLAY}" -localhost -geometry 1600x1200 -depth 16
export DISPLAY=:${NEW_DISPLAY}

echo "$PASSWORD" | x11vnc -storepasswd -input - | sudo tee ~/.vnc/passwd >/dev/null 2>&1

"$@"

export DISPLAY=${OLD_DISPLAY}
Expand Down

0 comments on commit c179678

Please sign in to comment.