Commit 40a777be authored by Thom Pol's avatar Thom Pol

Setup correct trigger for UAU install (#25)

parent 9e94c1d2
......@@ -281,6 +281,20 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
}
}
protected function installUnattendedUpgrades() {
ISPConfigLog::info('Installing UnattendedUpgrades', true);
$packages = array(
'unattended-upgrades',
'apt-listchanges'
);
$this->installPackages($packages);
// Enable UnattendUpgrades to run every day
$unattendedupgrades = 'APT::Periodic::Update-Package-Lists "1";' . "\n" . 'APT::Periodic::Unattended-Upgrade "1";';
file_put_contents('/etc/apt/apt.conf.d/20auto-upgrades', $unattendedupgrades);
}
protected function shallCompileJailkit() {
return true;
}
......@@ -389,22 +403,6 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
return $listpw;
}
protected function installUnattendedUpgrades() {
if(ISPConfig::shallInstall('unattended-upgrades')) {
ISPConfigLog::info('Installing UnattendedUpgrades', true);
$packages = array(
'unattended-upgrades',
'apt-listchanges'
);
$this->installPackages($packages);
// Enable UnattendUpgrades to run every day
$unattendedupgrades = 'APT::Periodic::Update-Package-Lists "1";' . "\n" . 'APT::Periodic::Unattended-Upgrade "1";';
file_put_contents('/etc/apt/apt.conf.d/20auto-upgrades', $unattendedupgrades);
}
}
protected function installPackages($packages) {
if(is_string($packages)) {
$packages = array($packages);
......@@ -1066,6 +1064,10 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
$this->fixDbconfigCommon();
if(ISPConfig::shallInstall('unattended-upgrades')) {
$this->installUnattendedUpgrades();
}
if(ISPConfig::shallInstall('mail') && ISPConfig::shallInstall('roundcube')) {
ISPConfigLog::info('Installing roundcube.', true);
......
......@@ -103,8 +103,8 @@ maxretry = 3';
}
protected function installUnattendedUpgrades() {
if(ISPConfig::shallInstall('unattended-upgrades')) {
ISPConfigLog::info('Installing UnattendedUpgrades', true);
$packages = array(
'unattended-upgrades',
'apt-listchanges'
......@@ -112,13 +112,7 @@ maxretry = 3';
$this->installPackages($packages);
// Enable UnattendUpgrades to run every day
$unattendedupgrades = 'APT::Periodic::Update-Package-Lists \"1\";' . "\n" . 'APT::Periodic::Unattended-Upgrade \"1\";';
$unattendedupgrades = 'APT::Periodic::Update-Package-Lists "1";' . "\n" . 'APT::Periodic::Unattended-Upgrade "1";';
file_put_contents('/etc/apt/apt.conf.d/20auto-upgrades', $unattendedupgrades);
// Enable normal updates
$replacements = array(
'/^\/\/\s*"\$\{distro_id\}:\$\{distro_codename\}\-updates";/m' => ' \"${distro_id}:${distro_codename}-updates\";'
);
$result = $this->replaceContents('/etc/apt/apt.conf.d/50unattended-upgrades', $replacements);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment