Commit 109c839f authored by EndelWar's avatar EndelWar

Add Devuan basic support

parent f28674ba
......@@ -220,6 +220,23 @@ function get_distname() {
}
}
//** Devuan
elseif(file_exists('/etc/devuan_version')) {
if(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'jessie')) {
$distname = 'Devuan';
$distver = 'Jessie';
$distid = 'debian60';
$distbaseid = 'debian';
swriteln("Operating System: Devuan 1.0 (Jessie) or compatible\n");
} elseif(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'ceres')) {
$distname = 'Devuan';
$distver = 'Ceres';
$distid = 'debiantesting';
$distbaseid = 'debian';
swriteln("Operating System: Devuan Unstable (Ceres) or compatible\n");
}
}
//** OpenSuSE
elseif(file_exists('/etc/SuSE-release')) {
if(stristr(file_get_contents('/etc/SuSE-release'), '11.0')) {
......
......@@ -1484,7 +1484,7 @@ class installer_base {
public function configure_spamassassin() {
global $conf;
//* Enable spamasasssin on debian and ubuntu
//* Enable spamasasssin on debian, devuan and ubuntu
$configfile = '/etc/default/spamassassin';
if(is_file($configfile)) {
copy($configfile, $configfile.'~');
......
......@@ -97,7 +97,7 @@ server {
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
# To access phpMyAdmin, the default user (like www-data on Debian/Ubuntu) must be used
# To access phpMyAdmin, the default user (like www-data on Debian/Devuan/Ubuntu) must be used
{use_tcp}fastcgi_pass 127.0.0.1:9000;
{use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
......@@ -147,7 +147,7 @@ server {
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
# To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
# To access SquirrelMail, the default user (like www-data on Debian/Devuan/Ubuntu) must be used
{use_tcp}fastcgi_pass 127.0.0.1:9000;
{use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
......
......@@ -94,7 +94,7 @@ $wb["named_conf_local_path_txt"] = 'BIND named.conf.local path';
$wb["php_ini_path_cgi_txt"] = 'CGI php.ini path';
$wb["php_ini_path_apache_txt"] = 'Apache php.ini path';
$wb["check_apache_config_txt"] = 'Test apache configuration on restart';
$wb["network_config_warning_txt"] = 'The network configuration option is only available for Debian and Ubuntu Servers. Do not enable this option if your network interface is not eth0.';
$wb["network_config_warning_txt"] = 'The network configuration option is only available for Debian, Devuan and Ubuntu Servers. Do not enable this option if your network interface is not eth0.';
$wb["CA_path_txt"] = 'CA Path';
$wb["CA_pass_txt"] = 'CA passphrase';
$wb["fastcgi_config_syntax_txt"] = 'FastCGI config syntax';
......
......@@ -83,7 +83,7 @@ $wb['ufw_default_forward_policy_txt'] = 'Default Forward Policy';
$wb['ufw_default_application_policy_txt'] = 'Default Application Policy';
$wb['ufw_log_level_txt'] = 'Livello di Log';
$wb['website_symlinks_rel_txt'] = 'Make relative symlinks';
$wb['network_config_warning_txt'] = 'L opzione di configurazione di rete è disponibile solo per Debian and Ubuntu Servers. Non abilitare se la tua interfaccia di rete non è eth0.';
$wb['network_config_warning_txt'] = 'L\'opzione di configurazione di rete è disponibile solo per Debian, Devuan e Ubuntu Server. Non abilitare se la tua interfaccia di rete non è eth0.';
$wb['CA_path_txt'] = 'Percorso CA';
$wb['CA_pass_txt'] = 'CA passphrase';
$wb['fastcgi_config_syntax_txt'] = 'Sintassi configurazione FastCGI';
......
......@@ -89,7 +89,7 @@ server {
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
# To access phpMyAdmin, the default user (like www-data on Debian/Ubuntu) must be used
# To access phpMyAdmin, the default user (like www-data on Debian/Devuan/Ubuntu) must be used
{use_tcp}fastcgi_pass 127.0.0.1:9000;
{use_socket}fastcgi_pass unix:{fpm_socket};
fastcgi_index index.php;
......@@ -139,7 +139,7 @@ server {
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
# To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
# To access SquirrelMail, the default user (like www-data on Debian/Devuan/Ubuntu) must be used
{use_tcp}fastcgi_pass 127.0.0.1:9000;
{use_socket}fastcgi_pass unix:{fpm_socket};
fastcgi_index index.php;
......
......@@ -70,8 +70,8 @@ class cronjob_monitor_system_update extends cronjob {
$type = 'system_update';
/* This monitoring is only available on Debian or Ubuntu */
if (file_exists('/etc/debian_version')) {
/* This monitoring is only available on Debian, Devuan or Ubuntu */
if (file_exists('/etc/debian_version') || file_exists('/etc/devuan_version')) {
/*
* first update the "apt database"
......
......@@ -207,6 +207,21 @@ class monitor_tools {
}
}
//** Devuan
elseif(file_exists('/etc/devuan_version')) {
if(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'jessie')) {
$distname = 'Devuan';
$distver = 'Jessie';
$distid = 'debian60';
$distbaseid = 'debian';
} elseif(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'ceres')) {
$distname = 'Devuan';
$distver = 'Testing';
$distid = 'debiantesting';
$distbaseid = 'debian';
}
}
//** OpenSuSE
elseif(file_exists('/etc/SuSE-release')) {
if(stristr(file_get_contents('/etc/SuSE-release'), '11.0')) {
......@@ -450,6 +465,8 @@ class monitor_tools {
if (@is_file('/etc/debian_version')) {
$dist = 'debian';
} elseif (@is_file('/etc/devuan_version')) {
$dist = 'devuan';
} elseif (@is_file('/etc/redhat-release')) {
$dist = 'redhat';
} elseif (@is_file('/etc/SuSE-release')) {
......@@ -462,6 +479,8 @@ class monitor_tools {
case 'log_mail':
if ($dist == 'debian') {
$logfile = '/var/log/mail.log';
} elseif ($dist == 'devuan') {
$logfile = '/var/log/mail.log';
} elseif ($dist == 'redhat') {
$logfile = '/var/log/maillog';
} elseif ($dist == 'suse') {
......@@ -473,6 +492,8 @@ class monitor_tools {
case 'log_mail_warn':
if ($dist == 'debian') {
$logfile = '/var/log/mail.warn';
} elseif ($dist == 'devuan') {
$logfile = '/var/log/mail.warn';
} elseif ($dist == 'redhat') {
$logfile = '/var/log/maillog';
} elseif ($dist == 'suse') {
......@@ -484,6 +505,8 @@ class monitor_tools {
case 'log_mail_err':
if ($dist == 'debian') {
$logfile = '/var/log/mail.err';
} elseif ($dist == 'devuan') {
$logfile = '/var/log/mail.err';
} elseif ($dist == 'redhat') {
$logfile = '/var/log/maillog';
} elseif ($dist == 'suse') {
......@@ -495,6 +518,8 @@ class monitor_tools {
case 'log_messages':
if ($dist == 'debian') {
$logfile = '/var/log/syslog';
} elseif ($dist == 'devuan') {
$logfile = '/var/log/syslog';
} elseif ($dist == 'redhat') {
$logfile = '/var/log/messages';
} elseif ($dist == 'suse') {
......@@ -506,6 +531,8 @@ class monitor_tools {
case 'log_ispc_cron':
if ($dist == 'debian') {
$logfile = $conf['ispconfig_log_dir'] . '/cron.log';
} elseif ($dist == 'devuan') {
$logfile = $conf['ispconfig_log_dir'] . '/cron.log';
} elseif ($dist == 'redhat') {
$logfile = $conf['ispconfig_log_dir'] . '/cron.log';
} elseif ($dist == 'suse') {
......@@ -517,6 +544,8 @@ class monitor_tools {
case 'log_freshclam':
if ($dist == 'debian') {
$logfile = '/var/log/clamav/freshclam.log';
} elseif ($dist == 'devuan') {
$logfile = '/var/log/clamav/freshclam.log';
} elseif ($dist == 'redhat') {
$logfile = (is_file('/var/log/clamav/freshclam.log') ? '/var/log/clamav/freshclam.log' : '/var/log/freshclam.log');
} elseif ($dist == 'suse') {
......@@ -528,6 +557,8 @@ class monitor_tools {
case 'log_clamav':
if ($dist == 'debian') {
$logfile = '/var/log/clamav/clamav.log';
} elseif ($dist == 'devuan') {
$logfile = '/var/log/clamav/clamav.log';
} elseif ($dist == 'redhat') {
$logfile = (is_file('/var/log/clamav/clamd.log') ? '/var/log/clamav/clamd.log' : '/var/log/maillog');
} elseif ($dist == 'suse') {
......@@ -539,6 +570,8 @@ class monitor_tools {
case 'log_fail2ban':
if ($dist == 'debian') {
$logfile = '/var/log/fail2ban.log';
} elseif ($dist == 'devuan') {
$logfile = '/var/log/fail2ban.log';
} elseif ($dist == 'redhat') {
$logfile = '/var/log/fail2ban.log';
} elseif ($dist == 'suse') {
......@@ -553,6 +586,8 @@ class monitor_tools {
case 'log_ispconfig':
if ($dist == 'debian') {
$logfile = $conf['ispconfig_log_dir'] . '/ispconfig.log';
} elseif ($dist == 'devuan') {
$logfile = $conf['ispconfig_log_dir'] . '/ispconfig.log';
} elseif ($dist == 'redhat') {
$logfile = $conf['ispconfig_log_dir'] . '/ispconfig.log';
} elseif ($dist == 'suse') {
......
......@@ -205,7 +205,7 @@ class firewall_plugin {
} else {
//* Ensure that bastille firewall is stopped
exec($conf['init_scripts'] . '/' . 'bastille-firewall stop 2>/dev/null');
if(@is_file('/etc/debian_version')) exec('update-rc.d -f bastille-firewall remove');
if(@is_file('/etc/debian_version') || @is_file('/etc/devuan_version')) exec('update-rc.d -f bastille-firewall remove');
//* Start ufw firewall
exec('ufw --force enable');
......@@ -258,12 +258,12 @@ class firewall_plugin {
exec('ufw disable');
}
exec($conf['init_scripts'] . '/' . 'bastille-firewall restart 2>/dev/null');
if(@is_file('/etc/debian_version')) exec('update-rc.d bastille-firewall defaults');
if(@is_file('/etc/debian_version') || @is_file('/etc/devuan_version')) exec('update-rc.d bastille-firewall defaults');
if(@is_file('/sbin/insserv')) exec('insserv -d bastille-firewall');
$app->log('Restarting the firewall', LOGLEVEL_DEBUG);
} else {
exec($conf['init_scripts'] . '/' . 'bastille-firewall stop 2>/dev/null');
if(@is_file('/etc/debian_version')) exec('update-rc.d -f bastille-firewall remove');
if(@is_file('/etc/debian_version') || @is_file('/etc/devuan_version')) exec('update-rc.d -f bastille-firewall remove');
if(@is_file('/sbin/insserv')) exec('insserv -r -f bastille-firewall');
$app->log('Stopping the firewall', LOGLEVEL_DEBUG);
}
......@@ -275,7 +275,7 @@ class firewall_plugin {
global $app, $conf;
exec($conf['init_scripts'] . '/' . 'bastille-firewall stop 2>/dev/null');
if(@is_file('/etc/debian_version')) exec('update-rc.d -f bastille-firewall remove');
if(@is_file('/etc/debian_version') || @is_file('/etc/devuan_version')) exec('update-rc.d -f bastille-firewall remove');
if(@is_file('/sbin/insserv')) exec('insserv -r -f bastille-firewall');
$app->log('Stopping the firewall', LOGLEVEL_DEBUG);
......
......@@ -86,7 +86,7 @@ class network_settings_plugin {
$server_config['ip_address'] != '0.0.0.0' &&
$server_config['gateway'] != '0.0.0.0') {
if (is_file('/etc/debian_version'))
if (is_file('/etc/debian_version') || is_file('/etc/devuan_version'))
{
copy('/etc/network/interfaces', '/etc/network/interfaces~');
......
......@@ -278,10 +278,10 @@ class software_update_plugin {
global $app;
//** Debian and compatible Linux distributions
if(file_exists('/etc/debian_version')) {
if(file_exists('/etc/debian_version') || file_exists('/etc/devuan_version')) {
exec("aptitude update");
exec("aptitude safe-upgrade -y");
$app->log('Execeuted Debian / Ubuntu update', LOGLEVEL_DEBUG);
$app->log('Execeuted Debian / Devuan / Ubuntu update', LOGLEVEL_DEBUG);
}
//** Gentoo Linux
......
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