Subversion Repositories ALCASAR

Rev

Rev 3285 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3285 Rev 3286
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-conf.sh 3285 2025-05-20 17:33:11Z rexy $
2
# $Id: alcasar-conf.sh 3286 2025-05-21 13:33:19Z 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 337... Line 337...
337
		hostnamectl set-hostname $HOSTNAME.$DOMAIN
337
		hostnamectl set-hostname $HOSTNAME.$DOMAIN
338
# /etc/hosts (retriving local hostnames)
338
# /etc/hosts (retriving local hostnames)
339
		cp /etc/hosts /tmp/hosts
339
		cp /etc/hosts /tmp/hosts
340
		echo "127.0.0.1	localhost" > /etc/hosts
340
		echo "127.0.0.1	localhost" > /etc/hosts
341
		echo "$PRIVATE_IP	$HOSTNAME $HOSTNAME.$DOMAIN" >> /etc/hosts
341
		echo "$PRIVATE_IP	$HOSTNAME $HOSTNAME.$DOMAIN" >> /etc/hosts
-
 
342
		$SED "/$PRIVATE_IP/d" /tmp/hosts
342
		while read -r line
343
		while read -r line
343
		do
344
		do
344
				if ! echo $line | grep -E -q "^([0-9\.\t ]+alcasar( |$)|127\.0\.0)"
345
				if ! echo $line | grep -E -q "^([0-9\.\t ]+alcasar( |$)|127\.0\.0)"
345
				then
346
				then
346
					echo $line >> /etc/hosts
347
					echo $line >> /etc/hosts
Line 495... Line 496...
495
			done
496
			done
496
			$DIR_BIN/alcasar-bl.sh -reload && echo -n ", unbound-blacklist, unbound-whitelist, e2guardian, iptables"
497
			$DIR_BIN/alcasar-bl.sh -reload && echo -n ", unbound-blacklist, unbound-whitelist, e2guardian, iptables"
497
			/usr/bin/systemctl restart httpd && echo -n ", httpd"
498
			/usr/bin/systemctl restart httpd && echo -n ", httpd"
498
		fi
499
		fi
499
# Email user registration
500
# Email user registration
-
 
501
		$SED "s?^smtpd_banner =.*?smtpd_banner = $HOSTNAME.$DOMAIN ESMTP?g" /etc/postfix/main.cf
-
 
502
		$SED "s?^myhostname =.*?myhostname = $HOSTNAME.$DOMAIN?g" /etc/postfix/main.cf
500
		export PARENT_SCRIPT # if "alcasar.sh" then avoid some process
503
		export PARENT_SCRIPT # if "alcasar.sh" then avoid some process
501
		$DIR_BIN/alcasar-mail-install.sh
504
		$DIR_BIN/alcasar-mail-install.sh
502
# Start / Stop LDAP authentification
505
# Start / Stop LDAP authentification
503
		if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
506
		if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
504
		then
507
		then