mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-01-23 14:29:06 +01:00
vncserver: refactor
This commit is contained in:
parent
59d53dbb19
commit
c435e6ba7d
@ -88,7 +88,7 @@ if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
|
|||||||
} elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
|
} elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
|
||||||
&Usage();
|
&Usage();
|
||||||
} else {
|
} else {
|
||||||
$displayNumber = &GetDisplayNumber();
|
$displayNumber = &GetLowestAvailableDisplayNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
$vncPort = 5900 + $displayNumber;
|
$vncPort = 5900 + $displayNumber;
|
||||||
@ -378,12 +378,12 @@ sub CheckGeometryAndDepth
|
|||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# GetDisplayNumber gets the lowest available display number. A display number
|
# GetLowestAvailableDisplayNumber gets the lowest available display number. A
|
||||||
# n is taken if something is listening on the VNC server port (5900+n) or the
|
# display number n is taken if something is listening on the VNC server port
|
||||||
# X server port (6000+n).
|
# (5900+n) or the X server port (6000+n).
|
||||||
#
|
#
|
||||||
|
|
||||||
sub GetDisplayNumber
|
sub GetLowestAvailableDisplayNumber
|
||||||
{
|
{
|
||||||
foreach $n (1..99) {
|
foreach $n (1..99) {
|
||||||
if (&CheckDisplayNumber($n)) {
|
if (&CheckDisplayNumber($n)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user