Subversion Repositories ALCASAR

Rev

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

Rev 2175 Rev 2454
Line 23... Line 23...
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_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 with uamallowed domains ($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
if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't restart on install stage
43
then
43
then
44
	systemctl restart dnsmasq-blackhole
44
	systemctl restart dnsmasq-blackhole
45
fi
-
 
46
 
45
fi
-
 
46