diff --git a/installJRMC b/installJRMC index 8536d72..012a443 100755 --- a/installJRMC +++ b/installJRMC @@ -1293,7 +1293,7 @@ service_jriver-xvnc() { systemctl_reload_cmd if ! systemctl_enable_cmd "$SERVICE_NAME"; then err "vncserver failed to start on DISPLAY $NEXT_DISPLAY" - err "Incrementing DISPLAY by one and retrying" + err "Incrementing DISPLAY and retrying" service_jriver-xvnc increment return fi @@ -1312,7 +1312,7 @@ service_jriver-x11vnc() { setServiceVars "${FUNCNAME[0]##*_}" setDisplay - declare start_cmd + declare -a start_cmd declare -g PORT=$(( DISPLAYNUM + 5900 )) installPackage x11vnc @@ -1327,10 +1327,19 @@ service_jriver-x11vnc() { xauth add "$HOST$DISPLAY" . "$(xxd -l 16 -p /dev/urandom)" fi + start_cmd=( + /usr/bin/x11vnc + -display "$DISPLAY" + -noscr + -auth guess + -forever + -bg + ) + if (( NOVNCAUTH )); then - start_cmd="/usr/bin/x11vnc -display $DISPLAY -noscr -auth guess -forever -bg -nopw" + start_cmd+=(-nopw) else - start_cmd="/usr/bin/x11vnc -display $DISPLAY -noscr -auth guess -forever -bg -rfbauth $HOME/.vnc/jrmc_passwd" + start_cmd+=(-rfbauth "$HOME/.vnc/jrmc_passwd") fi sudo bash -c "cat <<-EOF > $SERVICE_FNAME @@ -1342,7 +1351,7 @@ service_jriver-x11vnc() { $USER_STRING Type=forking Environment=DISPLAY=$DISPLAY - ExecStart=$start_cmd + ExecStart=${start_cmd[*]} Restart=always RestartSec=10