harshadyeola
10 years ago
21 changed files with 218 additions and 122 deletions
@ -0,0 +1,45 @@ |
|||||
|
# EasyEngine RAM based settings |
||||
|
|
||||
|
function ee_lib_ram() |
||||
|
{ |
||||
|
# Detect RAM of System |
||||
|
readonly EE_TOTAL_RAM=$(free -m | grep -i Mem | awk '{ print $2 }') |
||||
|
|
||||
|
# RAM < 512MB |
||||
|
if [ $EE_TOTAL_RAM -le 512 ]; then |
||||
|
EE_OPCACHE_SIZE="64" |
||||
|
EE_MEMCACHE_SIZE="64" |
||||
|
EE_PHP_MAX_CHILDREN="10" |
||||
|
EE_SETUP_MAILSCANNER="no" |
||||
|
# RAM > 512MB and RAM < 1024MB |
||||
|
elif [ $EE_TOTAL_RAM -gt 512 ] && [ $EE_TOTAL_RAM -le 1024 ]; then |
||||
|
EE_OPCACHE_SIZE="128" |
||||
|
EE_MEMCACHE_SIZE="128" |
||||
|
EE_PHP_MAX_CHILDREN="10" |
||||
|
# RAM > 1024MB and RAM < 2048MB |
||||
|
elif [ $EE_TOTAL_RAM -gt 1024 ] && [ $EE_TOTAL_RAM -le 2048 ]; then |
||||
|
EE_OPCACHE_SIZE="256" |
||||
|
EE_MEMCACHE_SIZE="256" |
||||
|
EE_PHP_MAX_CHILDREN="20" |
||||
|
# RAM > 2048MB and RAM < 4096MB |
||||
|
elif [ $EE_TOTAL_RAM -gt 2048 ] && [ $EE_TOTAL_RAM -le 4096 ]; then |
||||
|
EE_OPCACHE_SIZE="512" |
||||
|
EE_MEMCACHE_SIZE="512" |
||||
|
EE_PHP_MAX_CHILDREN="40" |
||||
|
# RAM > 4096MB and RAM < 8192MB |
||||
|
elif [ $EE_TOTAL_RAM -gt 4096 ] && [ $EE_TOTAL_RAM -le 8192 ]; then |
||||
|
EE_OPCACHE_SIZE="512" |
||||
|
EE_MEMCACHE_SIZE="1024" |
||||
|
EE_PHP_MAX_CHILDREN="80" |
||||
|
# RAM > 8192MB and RAM < 16384MB |
||||
|
elif [ $EE_TOTAL_RAM -gt 8192 ] && [ $EE_TOTAL_RAM -le 16384 ]; then |
||||
|
EE_OPCACHE_SIZE="512" |
||||
|
EE_MEMCACHE_SIZE="2048" |
||||
|
EE_PHP_MAX_CHILDREN="100" |
||||
|
# RAM > 16384MB |
||||
|
elif [ $EE_TOTAL_RAM -gt 16384 ]; then |
||||
|
EE_OPCACHE_SIZE="512" |
||||
|
EE_MEMCACHE_SIZE="2048" |
||||
|
EE_PHP_MAX_CHILDREN="100" |
||||
|
fi |
||||
|
} |
@ -1,6 +1,6 @@ |
|||||
# Install Amavis package |
# Install Amavis package |
||||
|
|
||||
function ee_mod_install_mailscan() |
function ee_mod_install_mailscaner() |
||||
{ |
{ |
||||
# Install Amavis |
# Install Amavis |
||||
ee_lib_echo "Installing Amavis, SpamAssassin and ClamAV, please wait..." |
ee_lib_echo "Installing Amavis, SpamAssassin and ClamAV, please wait..." |
@ -1,9 +0,0 @@ |
|||||
# Remove MailScan package |
|
||||
|
|
||||
function ee_mod_remove_mailscan() |
|
||||
{ |
|
||||
ee_lib_echo "$EE_SECOND Amavis, SpamAssassin and ClamAV package, please wait..." |
|
||||
$EE_APT_GET $EE_SECOND amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch lzop cabextract p7zip rpm unrar-free \ |
|
||||
|| ee_lib_error "Unable to $EE_SECOND Amavis, SpamAssassin and ClamAV,, exit status = " $? |
|
||||
|
|
||||
} |
|
@ -0,0 +1,18 @@ |
|||||
|
# Remove MailScan package |
||||
|
|
||||
|
function ee_mod_remove_mailscaner() |
||||
|
{ |
||||
|
|
||||
|
# Remove Amavis configuration from Postfix configuration |
||||
|
# Better approach is: postconf -X "content_filter", But available for Postfix 2.11 (latest) |
||||
|
sed -i '/content_filter/d' /etc/postfix/main.cf |
||||
|
sed -i '/content_filter/d' /etc/postfix/master.cf |
||||
|
sed -i '/receive_override_options/d' /etc/postfix/master.cf |
||||
|
sed -i '/smtp-amavis/,$d' /etc/postfix/master.cf |
||||
|
|
||||
|
#Remove/Purge mailscan packages |
||||
|
ee_lib_echo "$EE_SECOND Amavis, SpamAssassin and ClamAV package, please wait..." |
||||
|
$EE_APT_GET $EE_SECOND amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch lzop cabextract p7zip rpm unrar-free \ |
||||
|
|| ee_lib_error "Unable to $EE_SECOND Amavis, SpamAssassin and ClamAV,, exit status = " $? |
||||
|
|
||||
|
} |
Loading…
Reference in new issue