changed oddeven in notify.pl, restrict install.conf files with deploy.pl

This commit is contained in:
mischa 2021-05-18 12:47:43 +02:00
parent 047151d10e
commit a3ced25598
2 changed files with 5 additions and 2 deletions

View File

@ -28,6 +28,7 @@
# 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
# 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 strict;
@ -213,6 +214,8 @@ sub render_install_conf {
printf $fh_install "Continue anyway = yes\n";
printf $fh_install "Continue without verification = yes\n";
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";
} elsif (-e $_disk && -e "$_htdocs/$_mac-install.conf") {
unlink "$_htdocs/$_mac-install.conf" or warn "Unable to unlink file: $!\n";

View File

@ -77,7 +77,7 @@ sub mailout {
my $template = "$_tmpl/email-$function.txt";
my $server_number = $1 if $_server =~ /([0-9]+)/;
my $oddeven = $server_number % 2;
my $evenodd = $server_number % 2;
my $year = strftime("%Y", localtime);
my $month = strftime("%m", localtime);
@ -127,7 +127,7 @@ sub mailout {
if ($row =~ /TIME\((.*)\)/) {
my @TIMES = split(/,/, $1);
$row =~ s/TIME\(.*\)/$TIMES[$oddeven]/g;
$row =~ s/TIME\(.*\)/$TIMES[$evenodd]/g;
}
print $fh_email "$row\n";
}