Old harmless copy/paste from code above left code confusing as it was reusing the filehandle "XSTARTUP" to write out $vncUserDir/config. This new small change uses a more topical filehandle name for the task at hand.
if (!(-e "$vncUserDir/config")) {
warn "Creating default config $vncUserDir/config\n";
- open(XSTARTUP, ">$vncUserDir/config");
- print XSTARTUP $defaultConfig;
- close(XSTARTUP);
+ open(VNCUSERCONFIG, ">$vncUserDir/config");
+ print VNCUSERCONFIG $defaultConfig;
+ close(VNCUSERCONFIG);
chmod 0644, "$vncUserDir/config";
}