From 6b39371736e0c7cfde970ca8fb66586bad647408 Mon Sep 17 00:00:00 2001 From: Derek Yeh Date: Wed, 14 Jul 2021 17:13:39 -0700 Subject: [PATCH 1/4] remove interaction for vnc password --- modules/vnc.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/vnc.sh b/modules/vnc.sh index 7e5d56671f..eecca93a1d 100644 --- a/modules/vnc.sh +++ b/modules/vnc.sh @@ -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") @@ -143,7 +143,12 @@ function vnc { ;; "password") echo "Creating password of VNC service mode for VNC password authentication..." - vncpasswd -service + if [[ $2 ]] + then + $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" @@ -173,7 +178,7 @@ function vnc_help { echo " $BASENAME vnc auth " 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 } From aa22a19af0210ba71ab353ccd1d427c68da7e193 Mon Sep 17 00:00:00 2001 From: Derek Yeh Date: Wed, 14 Jul 2021 17:23:10 -0700 Subject: [PATCH 2/4] fix piping --- modules/vnc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/vnc.sh b/modules/vnc.sh index eecca93a1d..4efe2d335b 100644 --- a/modules/vnc.sh +++ b/modules/vnc.sh @@ -142,10 +142,10 @@ function vnc { esac ;; "password") - echo "Creating password of VNC service mode for VNC password authentication..." if [[ $2 ]] - then - $2 | vncpasswd -service + 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 From acf8e083f087811582bf8d3cdf8facd57e44a209 Mon Sep 17 00:00:00 2001 From: Derek Yeh Date: Wed, 14 Jul 2021 17:36:31 -0700 Subject: [PATCH 3/4] fix spacing --- modules/vnc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/vnc.sh b/modules/vnc.sh index 4efe2d335b..375565e537 100644 --- a/modules/vnc.sh +++ b/modules/vnc.sh @@ -147,7 +147,7 @@ function vnc { 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}." + echo "Please provide a password. Run 'treehouses vnc password {password}." fi ;; *) From a7b777d45fbb5e7789181cc98c8f34e08c552b4f Mon Sep 17 00:00:00 2001 From: Derek Yeh Date: Wed, 14 Jul 2021 17:39:43 -0700 Subject: [PATCH 4/4] fix spacing --- modules/vnc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/vnc.sh b/modules/vnc.sh index 375565e537..b18c88cd4c 100644 --- a/modules/vnc.sh +++ b/modules/vnc.sh @@ -144,10 +144,10 @@ function vnc { "password") if [[ $2 ]] then - echo "Creating password of VNC service mode for VNC password authentication..." - echo $2 | vncpasswd -service + 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}." + echo "Please provide a password. Run 'treehouses vnc password {password}." fi ;; *)