changed oddeven in notify.pl, restrict install.conf files with deploy.pl
This commit is contained in:
parent
047151d10e
commit
a3ced25598
|
@ -28,6 +28,7 @@
|
||||||
# 2020/09/20 changed: add agentx option to vm.conf for OpenBSD 7.0
|
# 2020/09/20 changed: add agentx option to vm.conf for OpenBSD 7.0
|
||||||
# 2020/10/25 changes: doas.conf for pkill option, so it works again
|
# 2020/10/25 changes: doas.conf for pkill option, so it works again
|
||||||
# 2021/01/19 changes: add format of disk images in vm.conf (CVE-2010-3851), thanx Johan Finnved
|
# 2021/01/19 changes: add format of disk images in vm.conf (CVE-2010-3851), thanx Johan Finnved
|
||||||
|
# 2021/05/18 changes: restrict the install.conf files in /var/www
|
||||||
#
|
#
|
||||||
use 5.024;
|
use 5.024;
|
||||||
use strict;
|
use strict;
|
||||||
|
@ -213,6 +214,8 @@ sub render_install_conf {
|
||||||
printf $fh_install "Continue anyway = yes\n";
|
printf $fh_install "Continue anyway = yes\n";
|
||||||
printf $fh_install "Continue without verification = yes\n";
|
printf $fh_install "Continue without verification = yes\n";
|
||||||
close $fh_install;
|
close $fh_install;
|
||||||
|
chmod 0440, "$_htdocs/$_mac-install.conf";
|
||||||
|
chown 67, 67, "$_htdocs/$_mac-install.conf";
|
||||||
printf "%16s %s created\n", $_instance, $_htdocs . "/" . $_mac . "-install.conf";
|
printf "%16s %s created\n", $_instance, $_htdocs . "/" . $_mac . "-install.conf";
|
||||||
} elsif (-e $_disk && -e "$_htdocs/$_mac-install.conf") {
|
} elsif (-e $_disk && -e "$_htdocs/$_mac-install.conf") {
|
||||||
unlink "$_htdocs/$_mac-install.conf" or warn "Unable to unlink file: $!\n";
|
unlink "$_htdocs/$_mac-install.conf" or warn "Unable to unlink file: $!\n";
|
||||||
|
|
|
@ -77,7 +77,7 @@ sub mailout {
|
||||||
|
|
||||||
my $template = "$_tmpl/email-$function.txt";
|
my $template = "$_tmpl/email-$function.txt";
|
||||||
my $server_number = $1 if $_server =~ /([0-9]+)/;
|
my $server_number = $1 if $_server =~ /([0-9]+)/;
|
||||||
my $oddeven = $server_number % 2;
|
my $evenodd = $server_number % 2;
|
||||||
my $year = strftime("%Y", localtime);
|
my $year = strftime("%Y", localtime);
|
||||||
my $month = strftime("%m", localtime);
|
my $month = strftime("%m", localtime);
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ sub mailout {
|
||||||
|
|
||||||
if ($row =~ /TIME\((.*)\)/) {
|
if ($row =~ /TIME\((.*)\)/) {
|
||||||
my @TIMES = split(/,/, $1);
|
my @TIMES = split(/,/, $1);
|
||||||
$row =~ s/TIME\(.*\)/$TIMES[$oddeven]/g;
|
$row =~ s/TIME\(.*\)/$TIMES[$evenodd]/g;
|
||||||
}
|
}
|
||||||
print $fh_email "$row\n";
|
print $fh_email "$row\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue