Use standard boilerplate for command-line scripts

This commit is contained in:
Jamie Cameron
2017-11-26 19:31:02 -08:00
parent 27e8aebbae
commit a834fb8bbe
2 changed files with 12 additions and 4 deletions

View File

@@ -2,11 +2,15 @@
# Called by the let's encrypt client to remove a DNS record for validation
$no_acl_check++;
$ENV{'WEBMIN_CONFIG'} = "/etc/webmin";
$ENV{'WEBMIN_VAR'} = "/var/webmin";
$ENV{'WEBMIN_CONFIG'} ||= "/etc/webmin";
$ENV{'WEBMIN_VAR'} ||= "/var/webmin";
if ($0 =~ /^(.*\/)[^\/]+$/) {
chdir($1);
}
else {
chop($pwd = `pwd`);
}
$0 = "$pwd/letsencrypt-cleanup.pl";
require './webmin-lib.pl';
&foreign_require("bind8");

View File

@@ -2,11 +2,15 @@
# Called by the let's encrypt client to add a DNS record for validation
$no_acl_check++;
$ENV{'WEBMIN_CONFIG'} = "/etc/webmin";
$ENV{'WEBMIN_VAR'} = "/var/webmin";
$ENV{'WEBMIN_CONFIG'} ||= "/etc/webmin";
$ENV{'WEBMIN_VAR'} ||= "/var/webmin";
if ($0 =~ /^(.*\/)[^\/]+$/) {
chdir($1);
}
else {
chop($pwd = `pwd`);
}
$0 = "$pwd/letsencrypt-dns.pl";
require './webmin-lib.pl';
&foreign_require("bind8");