333,18 → 333,13 |
EOF |
# Set hostname |
hostnamectl set-hostname $HOSTNAME.$DOMAIN |
# /etc/hosts (retriving local hostnames) |
cp /etc/hosts /tmp/hosts |
echo "127.0.0.1 localhost" > /etc/hosts |
echo "$PRIVATE_IP $HOSTNAME $HOSTNAME.$DOMAIN" >> /etc/hosts |
while read -r line |
do |
if ! echo $line | grep -E -q "^([0-9\.\t ]+alcasar( |$)|127\.0\.0)" |
then |
echo $line >> /etc/hosts |
fi |
done < /tmp/hosts |
rm -f /tmp/hosts |
# /etc/hosts |
domainNames="$HOSTNAME $HOSTNAME.$DOMAIN" |
[ "$HOSTNAME" != 'alcasar' ] && domainNames="alcasar $domainNames" |
$SED "/^$PRIVATE_IP\t/d" /etc/hosts |
$SED "/\s$HOSTNAME\s\$/d" /etc/hosts |
[ "$HOSTNAME" != 'alcasar' ] && $SED "/\salcasar\s\$/d" /etc/hosts |
echo "$PRIVATE_IP $domainNames" >> /etc/hosts |
# MOTD |
$SED "s@'https://\(.\+\)/acc'@'https://$HOSTNAME.$DOMAIN/acc'@" /etc/mageia-release |
# Lighttpd |
432,7 → 427,7 |
max-lease-time 43200; |
} |
EOF |
$DIR_BIN/alcasar-dns-local.sh -hosts_to_unbound # add local name resolution to unbound (forward & blackhole) |
$DIR_BIN/alcasar-dns-local.sh -hosts_to_unbound # add local name resoution to unbound (forward & blackhole) |
# tinyproxy |
$SED "s?^Listen.*?Listen $PRIVATE_IP?g" /etc/tinyproxy/tinyproxy.conf |
# DG + BL |