Skip to content

Commit 99d5dc8

Browse files
committed
Change Webalizer to incremental mode.
1 parent 0ea0630 commit 99d5dc8

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,19 @@ public function configure_apache()
445445
exec("ln -s ".$vhost_conf_dir."/ispconfig.conf ".$vhost_conf_enabled_dir."/000-ispconfig.conf");
446446
}
447447

448+
//* make sure that webalizer finds its config file when it is directly in /etc
449+
if(@is_file('/etc/webalizer.conf') && !@is_dir('/etc/webalizer')) {
450+
exec('mkdir /etc/webalizer');
451+
exec('ln -s /etc/webalizer.conf /etc/webalizer/webalizer.conf');
452+
}
453+
454+
if(is_file('/etc/webalizer/webalizer.conf')) {
455+
// Change webalizer mode to incremental
456+
replaceLine('/etc/webalizer/webalizer.conf','Incremental no','Incremental yes',0,0);
457+
replaceLine('/etc/webalizer/webalizer.conf','IncrementalName webalizer.current','IncrementalName webalizer.current',0,0);
458+
replaceLine('/etc/webalizer/webalizer.conf','HistoryName webalizer.hist','HistoryName webalizer.hist',0,0);
459+
}
460+
448461
//* add a sshusers group
449462
$command = 'groupadd sshusers';
450463
if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");

install/dist/lib/opensuse.lib.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,19 @@ public function configure_apache()
465465
exec("ln -s ".$vhost_conf_dir."/ispconfig.conf ".$vhost_conf_enabled_dir."/000-ispconfig.conf");
466466
}
467467

468+
//* make sure that webalizer finds its config file when it is directly in /etc
469+
if(@is_file('/etc/webalizer.conf') && !@is_dir('/etc/webalizer')) {
470+
exec('mkdir /etc/webalizer');
471+
exec('ln -s /etc/webalizer.conf /etc/webalizer/webalizer.conf');
472+
}
473+
474+
if(is_file('/etc/webalizer/webalizer.conf')) {
475+
// Change webalizer mode to incremental
476+
replaceLine('/etc/webalizer/webalizer.conf','Incremental no','Incremental yes',0,0);
477+
replaceLine('/etc/webalizer/webalizer.conf','IncrementalName webalizer.current','IncrementalName webalizer.current',0,0);
478+
replaceLine('/etc/webalizer/webalizer.conf','HistoryName webalizer.hist','HistoryName webalizer.hist',0,0);
479+
}
480+
468481
//* add a sshusers group
469482
$command = 'groupadd sshusers';
470483
if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");

install/lib/installer_base.lib.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,11 +819,16 @@ public function configure_apache()
819819
exec('ln -s /etc/webalizer.conf /etc/webalizer/webalizer.conf');
820820
}
821821

822+
if(is_file('/etc/webalizer/webalizer.conf')) {
823+
// Change webalizer mode to incremental
824+
replaceLine('/etc/webalizer/webalizer.conf','Incremental no','Incremental yes',0,0);
825+
replaceLine('/etc/webalizer/webalizer.conf','IncrementalName webalizer.current','IncrementalName webalizer.current',0,0);
826+
replaceLine('/etc/webalizer/webalizer.conf','HistoryName webalizer.hist','HistoryName webalizer.hist',0,0);
827+
}
828+
822829
//* add a sshusers group
823830
$command = 'groupadd sshusers';
824831
if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
825-
826-
827832

828833
}
829834

0 commit comments

Comments
 (0)