vncserver: extract CreateXstartup()

This commit is contained in:
Dmitry Maksyoma 2021-07-28 22:04:56 +12:00
parent 53c545a9ad
commit 25e761326f

21
unix/vncserver Normal file → Executable file
View File

@ -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";
}