mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-01-07 14:39:48 +01:00
vncserver: extract CreateUserConfigIfNeeded()
This commit is contained in:
parent
08ede14dfe
commit
69a2f9a13b
@ -129,14 +129,7 @@ if (! $skipxstartup) {
|
|||||||
&CreateXstartupIfNeeded();
|
&CreateXstartupIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create the user's config file if necessary.
|
&CreateUserConfigIfNeeded();
|
||||||
if (!(-e "$vncUserDir/config")) {
|
|
||||||
warn "Creating default config $vncUserDir/config\n";
|
|
||||||
open(VNCUSERCONFIG, ">$vncUserDir/config");
|
|
||||||
print VNCUSERCONFIG $defaultConfig;
|
|
||||||
close(VNCUSERCONFIG);
|
|
||||||
chmod 0644, "$vncUserDir/config";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Run the X startup script.
|
# Run the X startup script.
|
||||||
if (! $skipxstartup) {
|
if (! $skipxstartup) {
|
||||||
@ -958,3 +951,15 @@ sub WaitForXvncToStart {
|
|||||||
sub UsingSafeFontPath {
|
sub UsingSafeFontPath {
|
||||||
$fontPath eq $defFontPath
|
$fontPath eq $defFontPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub CreateUserConfigIfNeeded {
|
||||||
|
if (-e "$vncUserDir/config") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
warn "Creating default config $vncUserDir/config\n";
|
||||||
|
open(VNCUSERCONFIG, ">$vncUserDir/config");
|
||||||
|
print VNCUSERCONFIG $defaultConfig;
|
||||||
|
close(VNCUSERCONFIG);
|
||||||
|
chmod 0644, "$vncUserDir/config";
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user