Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 3179 2024-03-03 23:23:58Z rexy $
|
2 |
# $Id: alcasar.sh 3180 2024-03-04 17:33:37Z 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, lighttpd, 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, lighttpd, 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 206... |
Line 206... |
206 |
if [ $local_unbound_unit -ne 4 ]; then
|
206 |
if [ $local_unbound_unit -ne 4 ]; then
|
207 |
cp -f /lib/systemd/system/unbound*.service /etc/systemd/system/
|
207 |
cp -f /lib/systemd/system/unbound*.service /etc/systemd/system/
|
208 |
fi
|
208 |
fi
|
209 |
mode="update"
|
209 |
mode="update"
|
210 |
fi
|
210 |
fi
|
- |
|
211 |
else
|
- |
|
212 |
license
|
211 |
fi
|
213 |
fi
|
212 |
# Free /var (when updating) and test free space
|
214 |
# Free /var (when updating) and test free space
|
213 |
[ -d /var/log/netflow ] && rm -rf /var/log/netflow # remove old porttracker RRD database
|
215 |
[ -d /var/log/netflow ] && rm -rf /var/log/netflow # remove old porttracker RRD database
|
214 |
journalctl -q --vacuum-files 1 # remove previous journal logs
|
216 |
journalctl -q --vacuum-files 1 # remove previous journal logs
|
215 |
free_space=`df -BG --output=avail /var|tail -1|tr -d '[:space:]G'`
|
217 |
free_space=`df -BG --output=avail /var|tail -1|tr -d '[:space:]G'`
|
Line 2081... |
Line 2083... |
2081 |
{
|
2083 |
{
|
2082 |
[ -e /etc/php.d/05_mail.ini.default ] || cp /etc/php.d/05_mail.ini /etc/php.d/05_mail.ini.default
|
2084 |
[ -e /etc/php.d/05_mail.ini.default ] || cp /etc/php.d/05_mail.ini /etc/php.d/05_mail.ini.default
|
2083 |
$SED "s?^mail.add_x_header =.*?mail.add_x_header = Off?g" /etc/php.d/05_mail.ini
|
2085 |
$SED "s?^mail.add_x_header =.*?mail.add_x_header = Off?g" /etc/php.d/05_mail.ini
|
2084 |
[ -e /etc/postfix/main.cf.orig ] || cp /etc/postfix/main.cf /etc/postfix/main.cf.orig
|
2086 |
[ -e /etc/postfix/main.cf.orig ] || cp /etc/postfix/main.cf /etc/postfix/main.cf.orig
|
2085 |
$SED "s?^inet_protocols =.*?inet_protocols = ipv4?g" /etc/postfix/main.cf
|
2087 |
$SED "s?^inet_protocols =.*?inet_protocols = ipv4?g" /etc/postfix/main.cf
|
2086 |
$SED "s?^smtp_tls_security_level =.*?smtp_tls_security_level = encrypt?g" /etc/postfix/main.cf
|
2088 |
$SED "s?^smtp_tls_security_level =.*?smtp_tls_security_level = encrypt?g" /etc/postfix/main.cf
|
- |
|
2089 |
$SED "s?^smtpd_banner =.*?smtpd_banner = $myhostname ESMTP?g" /etc/postfix/main.cf
|
2087 |
cat << EOT >> /etc/postfix/main.cf
|
2090 |
cat << EOT >> /etc/postfix/main.cf
|
2088 |
smtputf8_enable = no
|
2091 |
smtputf8_enable = no
|
2089 |
smtp_use_tls = yes
|
2092 |
smtp_use_tls = yes
|
2090 |
smtp_tls_wrappermode = yes
|
2093 |
smtp_tls_wrappermode = yes
|
2091 |
smtp_sasl_auth_enable = yes
|
2094 |
smtp_sasl_auth_enable = yes
|
Line 2329... |
Line 2332... |
2329 |
-\? | -h* | --h*)
|
2332 |
-\? | -h* | --h*)
|
2330 |
echo "$usage"
|
2333 |
echo "$usage"
|
2331 |
exit 0
|
2334 |
exit 0
|
2332 |
;;
|
2335 |
;;
|
2333 |
-i | --install)
|
2336 |
-i | --install)
|
2334 |
for func in license system_testing network_testing
|
2337 |
for func in system_testing network_testing
|
2335 |
do
|
2338 |
do
|
2336 |
header_install
|
2339 |
header_install
|
2337 |
$func
|
2340 |
$func
|
2338 |
if [ $DEBUG_ALCASAR == "on" ]
|
2341 |
if [ $DEBUG_ALCASAR == "on" ]
|
2339 |
then
|
2342 |
then
|