From 04379056aff8ca459011385a98fefcef0b2c1e35 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Sat, 18 Sep 2021 22:50:49 +1200 Subject: [PATCH] vncserver: refactor --- unix/vncserver | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/unix/vncserver b/unix/vncserver index 00713cb..1058bfd 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -1170,11 +1170,19 @@ sub PrintLogFilenameAndConfiguredUsersAndStuff { warn "Log file is $desktopLog\n\n"; } +sub IsThisSystemBinary { + $0 =~ m!^/usr!; +} + sub DetectSelectDeBin { - if ($0 =~ m!^/usr!) { + if (&IsThisSystemBinary()) { "/usr/lib/kasmvncserver/select-de.sh"; } else { - my $dirname = dirname($0); - "$dirname/../builder/startup/deb/select-de.sh"; + &LocalSelectDePath(); } } + +sub LocalSelectDePath { + my $dirname = dirname($0); + "$dirname/../builder/startup/deb/select-de.sh"; +}