mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-01-23 06:18:59 +01:00
vncserver: split IfXvncDidntStartTryFixingFontPathAndStartXvncAgain()
This commit is contained in:
parent
7ee1522143
commit
8f58d9bc92
@ -114,7 +114,10 @@ $pidFile = "$vncUserDir/$host:$displayNumber.pid";
|
|||||||
&StartXvncAndRecordPID();
|
&StartXvncAndRecordPID();
|
||||||
&WaitForXvncToStart();
|
&WaitForXvncToStart();
|
||||||
|
|
||||||
&IfXvncDidntStartTryFixingFontPathAndStartXvncAgain();
|
if (!&IsXvncRunning() && !&UsingSafeFontPath()) {
|
||||||
|
&StartXvncWithSafeFontPath();
|
||||||
|
&WaitForXvncToStart();
|
||||||
|
}
|
||||||
|
|
||||||
unless (&IsXvncRunning()) {
|
unless (&IsXvncRunning()) {
|
||||||
&WarnUserXvncNotStartedAndExit();
|
&WarnUserXvncNotStartedAndExit();
|
||||||
@ -921,9 +924,7 @@ sub StartXvncAndRecordPID {
|
|||||||
system("$cmd & echo \$! >$pidFile");
|
system("$cmd & echo \$! >$pidFile");
|
||||||
}
|
}
|
||||||
|
|
||||||
sub IfXvncDidntStartTryFixingFontPathAndStartXvncAgain {
|
sub StartXvncWithSafeFontPath {
|
||||||
if ($fontPath ne $defFontPath) {
|
|
||||||
unless (&IsXvncRunning()) {
|
|
||||||
if ($fpArgSpecified) {
|
if ($fpArgSpecified) {
|
||||||
warn "\nWARNING: The first attempt to start Xvnc failed, probably because the font\n";
|
warn "\nWARNING: The first attempt to start Xvnc failed, probably because the font\n";
|
||||||
warn "path you specified using the -fp argument is incorrect. Attempting to\n";
|
warn "path you specified using the -fp argument is incorrect. Attempting to\n";
|
||||||
@ -937,9 +938,6 @@ sub IfXvncDidntStartTryFixingFontPathAndStartXvncAgain {
|
|||||||
$cmd =~ s@-fp [^ ]+@@;
|
$cmd =~ s@-fp [^ ]+@@;
|
||||||
$cmd .= " -fp $defFontPath" if ($defFontPath);
|
$cmd .= " -fp $defFontPath" if ($defFontPath);
|
||||||
&StartXvncAndRecordPID();
|
&StartXvncAndRecordPID();
|
||||||
&WaitForXvncToStart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub IsXvncRunning {
|
sub IsXvncRunning {
|
||||||
@ -958,3 +956,7 @@ sub WarnUserXvncNotStartedAndExit {
|
|||||||
sub WaitForXvncToStart {
|
sub WaitForXvncToStart {
|
||||||
sleep(3);
|
sleep(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub UsingSafeFontPath {
|
||||||
|
$fontPath eq $defFontPath
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user