From 93f25df996514d3c379ace469c1243ac1b357e6a Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 22 May 2019 09:49:38 +0200 Subject: [PATCH] ignore non-existent eula file in test mode Signed-off-by: Thomas Lamprecht --- proxinstall | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxinstall b/proxinstall index fa51b17..f865835 100755 --- a/proxinstall +++ b/proxinstall @@ -1742,7 +1742,11 @@ sub display_html { my $data = file_get_contents($path); if ($filename eq 'license.htm') { - my $license = decode('utf8', file_get_contents("${proxmox_cddir}/EULA")); + my $license = eval { decode('utf8', file_get_contents("${proxmox_cddir}/EULA")) }; + if (my $err = $@) { + die $err if !$opt_testmode; + $license = "TESTMODE: Ignore non existent EULA...\n"; + } my $title = "END USER LICENSE AGREEMENT (EULA)"; $data =~ s/__LICENSE__/$license/; $data =~ s/__LICENSE_TITLE__/$title/; -- 2.39.2