Downloader: Install perl modules and set up environment

Signed-off-by: Robert C. Helling <helling@lmu.de>
This commit is contained in:
Robert C. Helling 2024-01-27 23:14:13 +01:00 committed by Dirk Hohndel
parent 301059c6c9
commit 4fdaf3e8de
2 changed files with 14 additions and 5 deletions

View file

@ -17,6 +17,10 @@ my %conf;
# Use unbuffered output
$| = 1;
# Setup some environemnt variables to make subsurface startup happy
$ENV{HOME} = '/tmp';
$ENV{LOGNAME} = 'www-data';
my $q = CGI->new;
print $q->header('text/html');
@ -114,7 +118,7 @@ print $q->end_form();
print $q->br(), $q->a({-href => $q->url() . "?action=config"}, "Configure cloud credentials");
sub load_supported_dcs {
open IN, "/home/pi/src/subsurface/build/subsurface-downloader --list-dc|";
open IN, "$downloader --list-dc|" || die "Cannot run $downloader: $!";
while(<IN>) {
last if /Supported dive computers:/;