Subversion Repositories ALCASAR

Rev

Rev 2044 | Rev 2454 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2044 Rev 2175
Line 21... Line 21...
21
	sort -k2n $file > /tmp/alcasar-tmp-sort
21
	sort -k2n $file > /tmp/alcasar-tmp-sort
22
	mv -f /tmp/alcasar-tmp-sort $file
22
	mv -f /tmp/alcasar-tmp-sort $file
23
done
23
done
24
 
24
 
25
# remove empty lines and put rights
25
# remove empty lines and put rights
26
for file in $ALCASAR_SERVICES $ALCASAR_EXCEPTIONS $ALCASAR_IP_BLOCKED $ALCASAR_CONF $ALCASAR_UAMDOMAIN $ALCASAR_UAMALLOWED
26
for file in $ALCASAR_SERVICES $ALCASAR_IP_BLOCKED $ALCASAR_CONF $ALCASAR_UAMDOMAIN $ALCASAR_UAMALLOWED
27
do
27
do
28
	$SED "/^$/d" $file 
28
	$SED "/^$/d" $file 
29
	chown root:apache $file
29
	chown root:apache $file
30
	chmod 660 $file
30
	chmod 660 $file
31
done
31
done
32
 
32
 
33
#update dnsmasq-blackhole for uamallowed ALCASAR_UAMDOMAIN
33
#update dnsmasq-blackhole with uamallowed domains ($ALCASAR_UAMDOMAIN)
34
#remove old configuration
34
#remove old configuration
35
sed -i '/^server=/d' /etc/dnsmasq-blackhole.conf
35
sed -i '/^server=/d' /etc/dnsmasq-blackhole.conf
36
 
36
 
37
for domain in $(cat $ALCASAR_UAMDOMAIN | cut -d' ' -f1)
37
for domain in $(cat $ALCASAR_UAMDOMAIN | cut -d' ' -f1)
38
do
38
do
39
        domain_exception="server=/$(echo $domain | cut -d'"' -f2)/#"
39
        domain_exception="server=/$(echo $domain | cut -d'"' -f2)/#"
40
        sed -i "/conf-file/a$domain_exception" /etc/dnsmasq-blackhole.conf
40
        sed -i "/conf-file/a$domain_exception" /etc/dnsmasq-blackhole.conf
41
done
41
done
-
 
42
if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't restart on install stage
42
 
43
then
43
systemctl restart dnsmasq-blackhole
44
	systemctl restart dnsmasq-blackhole
-
 
45
fi
44
 
46