vncserver: extract DetectUserName

This commit is contained in:
Dmitry Maksyoma 2021-07-31 00:01:45 +12:00
parent 5811e14b42
commit a3b9a96df7

View File

@ -40,8 +40,7 @@ $geometry = "1024x768";
$vncUserDir = "$ENV{HOME}/.vnc";
$vncUserConfig = "$vncUserDir/config";
$vncUserName = `id -u -n`;
$vncUserName =~ s/^\s+|\s+$//g;
$vncUserName = &DetectUserName();
$vncSystemConfigDir = "/etc/kasmvnc";
$vncSystemConfigDefaultsFile = "$vncSystemConfigDir/vncserver-config-defaults";
@ -933,3 +932,10 @@ sub DetectBinariesDir {
return $result;
}
sub DetectUserName {
my $vncUserName = `id -u -n`;
$vncUserName =~ s/^\s+|\s+$//g;
return $vncUserName;
}