Subversion Repositories ALCASAR

Rev

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

Rev 1578 Rev 2044
Line 13... Line 13...
13
ALCASAR_IP_BLOCKED="$DIR_CONF/alcasar-ip-blocked"
13
ALCASAR_IP_BLOCKED="$DIR_CONF/alcasar-ip-blocked"
14
ALCASAR_UAMDOMAIN="$DIR_CONF/alcasar-uamdomain"
14
ALCASAR_UAMDOMAIN="$DIR_CONF/alcasar-uamdomain"
15
ALCASAR_UAMALLOWED="$DIR_CONF/alcasar-uamallowed"
15
ALCASAR_UAMALLOWED="$DIR_CONF/alcasar-uamallowed"
16
ALCASAR_CONF="$DIR_CONF/alcasar.conf"
16
ALCASAR_CONF="$DIR_CONF/alcasar.conf"
17
 
17
 
18
 
-
 
19
# sort file content
18
# sort file content
20
for file in $ALCASAR_SERVICES $ALCASAR_IP_BLOCKED $ALCASAR_UAMDOMAIN $ALCASAR_UAMALLOWED
19
for file in $ALCASAR_SERVICES $ALCASAR_IP_BLOCKED $ALCASAR_UAMDOMAIN $ALCASAR_UAMALLOWED
21
do
20
do
22
	sort -k2n $file > /tmp/alcasar-tmp-sort
21
	sort -k2n $file > /tmp/alcasar-tmp-sort
23
	mv -f /tmp/alcasar-tmp-sort $file
22
	mv -f /tmp/alcasar-tmp-sort $file
Line 28... Line 27...
28
do
27
do
29
	$SED "/^$/d" $file 
28
	$SED "/^$/d" $file 
30
	chown root:apache $file
29
	chown root:apache $file
31
	chmod 660 $file
30
	chmod 660 $file
32
done
31
done
-
 
32
 
-
 
33
#update dnsmasq-blackhole for uamallowed ALCASAR_UAMDOMAIN
-
 
34
#remove old configuration
-
 
35
sed -i '/^server=/d' /etc/dnsmasq-blackhole.conf
-
 
36
 
-
 
37
for domain in $(cat $ALCASAR_UAMDOMAIN | cut -d' ' -f1)
-
 
38
do
-
 
39
        domain_exception="server=/$(echo $domain | cut -d'"' -f2)/#"
-
 
40
        sed -i "/conf-file/a$domain_exception" /etc/dnsmasq-blackhole.conf
-
 
41
done
-
 
42
 
-
 
43
systemctl restart dnsmasq-blackhole