Fix addition of --nofork arg

This commit is contained in:
Jamie Cameron
2022-06-18 11:03:59 -07:00
parent 5063d29ac8
commit 1024adc6af

View File

@@ -9,6 +9,7 @@ use Time::Local;
eval "use Time::HiRes;";
@itoa64 = split(//, "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
@miniserv_argv = @ARGV;
# Find and read config file
if ($ARGV[0] eq "--nofork") {
@@ -113,7 +114,6 @@ if (!-x $perl_path) {
if (-l $perl_path) {
$linked_perl_path = readlink($perl_path);
}
@miniserv_argv = @ARGV;
# Check vital config options
&update_vital_config();
@@ -3108,7 +3108,7 @@ dbmclose(%sessiondb);
kill('KILL', $logclearer) if ($logclearer);
kill('KILL', $extauth) if ($extauth);
if (&indexof("--nofork", @miniserv_argv) < 0) {
push(@miniserv_argv, "--nofork");
unshift(@miniserv_argv, "--nofork");
}
exec($perl_path, $miniserv_path, @miniserv_argv);
die "Failed to restart miniserv with $perl_path $miniserv_path";