diff --git a/unix/vncserver b/unix/vncserver old mode 100644 new mode 100755 index 1231928..82feabf --- a/unix/vncserver +++ b/unix/vncserver @@ -386,13 +386,7 @@ warn "\nUsername: $vncUserName\n\n"; # Create the user's xstartup script if necessary. if (! $skipxstartup) { - if (!(-e "$xstartupFile")) { - warn "Creating default startup script $xstartupFile\n"; - open(XSTARTUP, ">$xstartupFile"); - print XSTARTUP $defaultXStartup; - close(XSTARTUP); - chmod 0755, "$xstartupFile"; - } + &CreateXstartup(); } # Create the user's config file if necessary. @@ -909,3 +903,16 @@ sub SanityCheck $SOCK_STREAM = &SOCK_STREAM; } } + +sub CreateXstartup +{ + if ((-e "$xstartupFile")) { + return; + } + + warn "Creating default startup script $xstartupFile\n"; + open(XSTARTUP, ">$xstartupFile"); + print XSTARTUP $defaultXStartup; + close(XSTARTUP); + chmod 0755, "$xstartupFile"; +}