| Line 1... |
Line 1... |
| 1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
| 2 |
# $Id: alcasar-conf.sh 3043 2022-07-22 17:10:23Z rexy $
|
2 |
# $Id: alcasar-conf.sh 3099 2022-12-28 11:30:30Z rexy $
|
| 3 |
|
3 |
|
| 4 |
# alcasar-conf.sh
|
4 |
# alcasar-conf.sh
|
| 5 |
# by REXY
|
5 |
# by REXY
|
| 6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
| 7 |
|
7 |
|
| Line 193... |
Line 193... |
| 193 |
# admin profile update (admin + manager + backup)
|
193 |
# admin profile update (admin + manager + backup)
|
| 194 |
$DIR_BIN/alcasar-profil.sh --list
|
194 |
$DIR_BIN/alcasar-profil.sh --list
|
| 195 |
# Apply changes between versions
|
195 |
# Apply changes between versions
|
| 196 |
## V5.4 --> V5.5 ##
|
196 |
## V5.4 --> V5.5 ##
|
| 197 |
[ -e $DIR_ETC/alcasar-iptables-local.sh ] && cp $DIR_ETC/alcasar-iptables-local.sh $DIR_ETC/alcasar-iptables-local.sh.old && cp $CURRENT_DIR/conf/etc/alcasar-iptables-local.sh $DIR_ETC/ # new rule for SMTP output flows
|
197 |
[ -e $DIR_ETC/alcasar-iptables-local.sh ] && cp $DIR_ETC/alcasar-iptables-local.sh $DIR_ETC/alcasar-iptables-local.sh.old && cp $CURRENT_DIR/conf/etc/alcasar-iptables-local.sh $DIR_ETC/ # new rule for SMTP output flows
|
| - |
|
198 |
## V5.5 --> V6.0 ## remove dnsmasq service
|
| - |
|
199 |
[ -e /etc/dnsmasq-whitelist.conf ] && rm -f /etc/dnsmasq*
|
| - |
|
200 |
[ -e /etc/systemd/system/dnsmasq-whitelist.service ] && rm -f /etc/systemd/system/dnsmasq* && urpme dnsmasq
|
| 198 |
# Remove the update folder
|
201 |
# Remove the update folder
|
| 199 |
rm -rf $DIR_UPDATE
|
202 |
rm -rf $DIR_UPDATE
|
| 200 |
;;
|
203 |
;;
|
| 201 |
|
204 |
|
| 202 |
####################################################
|
205 |
####################################################
|
| Line 295... |
Line 298... |
| 295 |
$DIR_BIN/alcasar-dns-local.sh --reload
|
298 |
$DIR_BIN/alcasar-dns-local.sh --reload
|
| 296 |
# Logout everybody
|
299 |
# Logout everybody
|
| 297 |
$DIR_BIN/alcasar-logout.sh all
|
300 |
$DIR_BIN/alcasar-logout.sh all
|
| 298 |
# Services stop
|
301 |
# Services stop
|
| 299 |
echo -n "Stop services : "
|
302 |
echo -n "Stop services : "
|
| 300 |
for i in ntpd e2guardian unbound unbound-whitelist dnsmasq-whitelist unbound-blacklist unbound-blackhole chilli network lighttpd
|
303 |
for i in ntpd e2guardian unbound unbound-whitelist unbound-blacklist unbound-blackhole chilli network lighttpd
|
| 301 |
do
|
304 |
do
|
| 302 |
/usr/bin/systemctl stop $i && echo -n "$i, "
|
305 |
/usr/bin/systemctl stop $i && echo -n "$i, "
|
| 303 |
done
|
306 |
done
|
| 304 |
echo
|
307 |
echo
|
| 305 |
fi
|
308 |
fi
|
| Line 370... |
Line 373... |
| 370 |
$SED "s?^dns1.*?dns1\t\t$PRIVATE_IP?g" /etc/chilli.conf
|
373 |
$SED "s?^dns1.*?dns1\t\t$PRIVATE_IP?g" /etc/chilli.conf
|
| 371 |
$SED "s?^dns2.*?dns2\t\t$PRIVATE_IP?g" /etc/chilli.conf
|
374 |
$SED "s?^dns2.*?dns2\t\t$PRIVATE_IP?g" /etc/chilli.conf
|
| 372 |
$SED "s?^uamlisten.*?uamlisten\t$PRIVATE_IP?g" /etc/chilli.conf
|
375 |
$SED "s?^uamlisten.*?uamlisten\t$PRIVATE_IP?g" /etc/chilli.conf
|
| 373 |
# modify the DHCP static ip file. Reserve the second IP address for INTIF (the first one is for tun0). Keep previous entries
|
376 |
# modify the DHCP static ip file. Reserve the second IP address for INTIF (the first one is for tun0). Keep previous entries
|
| 374 |
$SED "s?^$PRIVATE_MAC.*?$PRIVATE_MAC $PRIVATE_SECOND_IP?" $DIR_ETC/alcasar-ethers $DIR_ETC/alcasar-ethers-info
|
377 |
$SED "s?^$PRIVATE_MAC.*?$PRIVATE_MAC $PRIVATE_SECOND_IP?" $DIR_ETC/alcasar-ethers $DIR_ETC/alcasar-ethers-info
|
| 375 |
# dnsmasq-whitelist
|
- |
|
| 376 |
$SED "/^server=/d" /etc/dnsmasq-whitelist.conf
|
- |
|
| 377 |
echo "server=$DNS1" >> /etc/dnsmasq-whitelist.conf
|
- |
|
| 378 |
echo "server=$DNS2" >> /etc/dnsmasq-whitelist.conf
|
- |
|
| 379 |
# unbound
|
378 |
# unbound
|
| 380 |
# removing unbound configuration files
|
379 |
# removing unbound configuration files
|
| 381 |
rm -f /etc/unbound/conf.d/{forward,blacklist,whitelist,blackhole}/iface.*
|
380 |
rm -f /etc/unbound/conf.d/{forward,blacklist,whitelist,blackhole}/iface.*
|
| 382 |
rm -f /etc/unbound/conf.d/common/forward-zone.conf
|
381 |
rm -f /etc/unbound/conf.d/common/forward-zone.conf
|
| 383 |
# Configuration file for the dns servers forward-zone
|
382 |
# Configuration file for the dns servers forward-zone
|
| Line 488... |
Line 487... |
| 488 |
for i in unbound unbound-blackhole ntpd
|
487 |
for i in unbound unbound-blackhole ntpd
|
| 489 |
do
|
488 |
do
|
| 490 |
sleep 1
|
489 |
sleep 1
|
| 491 |
/usr/bin/systemctl start $i && echo -n ", $i"
|
490 |
/usr/bin/systemctl start $i && echo -n ", $i"
|
| 492 |
done
|
491 |
done
|
| 493 |
$DIR_BIN/alcasar-bl.sh -reload && echo -n ", unbound-blacklist, unbound-whitelist, dnsmasq-whitelist, e2guardian, iptables"
|
492 |
$DIR_BIN/alcasar-bl.sh -reload && echo -n ", unbound-blacklist, unbound-whitelist, e2guardian, iptables"
|
| 494 |
/usr/bin/systemctl restart lighttpd && echo -n ", lighttpd"
|
493 |
/usr/bin/systemctl restart lighttpd && echo -n ", lighttpd"
|
| 495 |
fi
|
494 |
fi
|
| 496 |
# Email user registration
|
495 |
# Email user registration
|
| 497 |
$DIR_BIN/alcasar-mail-install.sh
|
496 |
$DIR_BIN/alcasar-mail-install.sh
|
| 498 |
# Start / Stop LDAP authentification
|
497 |
# Start / Stop LDAP authentification
|