Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove interaction from treehouses vnc password (fixes #2242) #2244

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions modules/vnc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ function vnc {
echo "Authentication=VncAuth" >> /root/.vnc/config.d/vncserver-x11
fi
restart_vnc_service > /dev/null 2>&1
echo "Create your password, run 'treehouses vnc passwd'."
echo "Create your password, run 'treehouses vnc password {password}'."
echo "Please reboot the system for changes to take effect."
else
echo "Please create a password first, run 'treehouses vnc password'."
echo "Please create a password first, run 'treehouses vnc password {password}'."
fi
;;
"info")
Expand All @@ -142,8 +142,13 @@ function vnc {
esac
;;
"password")
echo "Creating password of VNC service mode for VNC password authentication..."
vncpasswd -service
if [[ $2 ]]
then
echo "Creating password of VNC service mode for VNC password authentication..."
echo $2 | vncpasswd -service
else
echo "Please provide a password. Run 'treehouses vnc password {password}."
fi
;;
*)
log_and_exit1 "Error: only 'on', 'off', 'info', 'auth', 'password' options are supported"
Expand Down Expand Up @@ -173,7 +178,7 @@ function vnc_help {
echo " $BASENAME vnc auth <system|vnc|info>"
echo " Change the VNC server authentication way (system default or vnc password)."
echo
echo " $BASENAME vnc password"
echo " $BASENAME vnc password {password}"
echo " Create password of VNC service mode for VNC password authentication."
echo
}