Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 3285 2025-05-20 17:33:11Z rexy $
|
2 |
# $Id: alcasar.sh 3286 2025-05-21 13:33:19Z rexy $
|
3 |
|
3 |
|
4 |
# ALCASAR is a Free and open source NAC (Network Access Controler) created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
|
4 |
# ALCASAR is a Free and open source NAC (Network Access Controler) created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
|
5 |
# ALCASAR is based on a stripped Mageia (LSB) with the following open source softwares Coovachilli, freeradius, mariaDB, apache, php, netfilter, e2guardian, ntpd, openssl, unbound, gammu, Ulog, fail2ban, vnstat, wkhtml2pdf, ipt_NETFLOW, NFsen and NFdump
|
5 |
# ALCASAR is based on a stripped Mageia (LSB) with the following open source softwares Coovachilli, freeradius, mariaDB, apache, php, netfilter, e2guardian, ntpd, openssl, unbound, gammu, Ulog, fail2ban, vnstat, wkhtml2pdf, ipt_NETFLOW, NFsen and NFdump
|
6 |
# contact : info@alcasar.net
|
6 |
# contact : info@alcasar.net
|
7 |
|
7 |
|
Line 2230... |
Line 2230... |
2230 |
rm -rf /tmp/acme.sh-*
|
2230 |
rm -rf /tmp/acme.sh-*
|
2231 |
} # End of letsencrypt()
|
2231 |
} # End of letsencrypt()
|
2232 |
|
2232 |
|
2233 |
##################################################################
|
2233 |
##################################################################
|
2234 |
## "mail_service" ##
|
2234 |
## "mail_service" ##
|
2235 |
## - Install Postfix conf for email registration method ##
|
2235 |
## - Postfix/cyrus-sasl conf for email registration method ##
|
2236 |
##################################################################
|
2236 |
##################################################################
|
2237 |
mail_service()
|
2237 |
mail_service()
|
2238 |
{
|
2238 |
{
|
2239 |
[ -e /etc/php.d/05_mail.ini.default ] || cp /etc/php.d/05_mail.ini /etc/php.d/05_mail.ini.default
|
2239 |
[ -e /etc/php.d/05_mail.ini.default ] || cp /etc/php.d/05_mail.ini /etc/php.d/05_mail.ini.default
|
2240 |
$SED "s?^mail.add_x_header =.*?mail.add_x_header = Off?g" /etc/php.d/05_mail.ini
|
2240 |
$SED "s?^mail.add_x_header =.*?mail.add_x_header = Off?g" /etc/php.d/05_mail.ini
|
2241 |
[ -e /etc/postfix/main.cf.orig ] || cp /etc/postfix/main.cf /etc/postfix/main.cf.orig
|
2241 |
[ -e /etc/postfix/main.cf.orig ] || cp /etc/postfix/main.cf /etc/postfix/main.cf.orig
|
2242 |
$SED "s?^inet_protocols =.*?inet_protocols = ipv4?g" /etc/postfix/main.cf
|
2242 |
$SED "s?^inet_protocols =.*?inet_protocols = ipv4?g" /etc/postfix/main.cf
|
2243 |
$SED "s?^smtp_tls_security_level =.*?smtp_tls_security_level = encrypt?g" /etc/postfix/main.cf
|
2243 |
$SED "s?^smtp_tls_security_level =.*?smtp_tls_security_level = encrypt?g" /etc/postfix/main.cf
|
2244 |
$SED "s?^smtpd_banner =.*?smtpd_banner = $myhostname ESMTP?g" /etc/postfix/main.cf
|
2244 |
$SED "s?^smtpd_banner =.*?smtpd_banner = $HOSTNAME.$DOMAIN ESMTP?g" /etc/postfix/main.cf
|
2245 |
cat << EOT >> /etc/postfix/main.cf
|
2245 |
cat << EOT >> /etc/postfix/main.cf
|
2246 |
smtputf8_enable = no
|
2246 |
smtputf8_enable = no
|
2247 |
smtp_use_tls = yes
|
2247 |
smtp_use_tls = yes
|
2248 |
smtp_tls_wrappermode = yes
|
2248 |
smtp_tls_wrappermode = yes
|
2249 |
smtp_sasl_auth_enable = yes
|
2249 |
smtp_sasl_auth_enable = yes
|
2250 |
smtp_sasl_security_options = noanonymous
|
2250 |
smtp_sasl_security_options = noanonymous
|
2251 |
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
|
2251 |
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
|
2252 |
relayhost =
|
2252 |
relayhost =
|
2253 |
myhostname = $HOSTNAME.$DOMAIN
|
2253 |
myhostname = $HOSTNAME.$DOMAIN
|
2254 |
EOT
|
2254 |
EOT
|
- |
|
2255 |
[ -e /etc/postfix/aliases.default ] || cp /etc/postfix/aliases /etc/postfix/aliases.default
|
- |
|
2256 |
human_user=`grep -E "x:1000:" /etc/passwd | cut -d":" -f1`
|
- |
|
2257 |
grep -Eq 'root:\s+postfix$' /etc/postfix/aliases && $SED "/root:/ s/postfix/$human_user/" /etc/postfix/aliases && newaliases
|
2255 |
chown -R postfix:postfix /var/lib/postfix
|
2258 |
chown -R postfix:postfix /var/lib/postfix
|
2256 |
} # end of mail_service
|
2259 |
} # end of mail_service
|
2257 |
|
2260 |
|
2258 |
##################################################################
|
2261 |
##################################################################
|
2259 |
## Fonction "post_install" ##
|
2262 |
## Fonction "post_install" ##
|