Subversion Repositories ALCASAR

Rev

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

Rev 1544 Rev 1547
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1544 2014-12-23 16:48:10Z richard $ 
2
#  $Id: alcasar.sh 1547 2014-12-23 17:25:24Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
 
5
 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
7
# Ce programme est un logiciel libre ; This software is free and open source
7
# Ce programme est un logiciel libre ; This software is free and open source
Line 1286... Line 1286...
1286
	echo "# Whitelist youtube flow" >> /etc/havp/whitelist
1286
	echo "# Whitelist youtube flow" >> /etc/havp/whitelist
1287
	echo "*.youtube.com/*" >> /etc/havp/whitelist
1287
	echo "*.youtube.com/*" >> /etc/havp/whitelist
1288
# adapt init script and systemd unit
1288
# adapt init script and systemd unit
1289
	[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
1289
	[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
1290
	cp -f $DIR_CONF/havp-init /etc/init.d/havp
1290
	cp -f $DIR_CONF/havp-init /etc/init.d/havp
-
 
1291
	[ -e /lib/systemd/system/havp.service.default ] || cp /lib/systemd/system/havp.service /lib/systemd/system/havp.service.default
1291
	$SED "/^PIDFile/i ExecStartPre=/bin/mkdir /var/run/havp" /lib/systemd/system/havp.service
1292
	$SED "/^PIDFile/i ExecStartPre=/bin/mkdir -p /var/run/havp" /lib/systemd/system/havp.service
1292
	$SED "/^PIDFile/i ExecStartPre=/bin/chown -R havp:havp /var/run/havp /var/log/havp" /lib/systemd/system/havp.service
1293
	$SED "/^PIDFile/i ExecStartPre=/bin/chown -R havp:havp /var/run/havp /var/log/havp" /lib/systemd/system/havp.service
1293
# replace of the intercept page (template)
1294
# replace of the intercept page (template)
1294
	cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
1295
	cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
1295
	cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html
1296
	cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html
1296
# update virus database every 4 hours (24h/6)
1297
# update virus database every 4 hours (24h/6)
Line 1569... Line 1570...
1569
bogus-priv
1570
bogus-priv
1570
filterwin2k
1571
filterwin2k
1571
EOF
1572
EOF
1572
 
1573
 
1573
# the main instance should start after network and chilli (which create tun0)
1574
# the main instance should start after network and chilli (which create tun0)
1574
	[ -e /lib/systemd/system/dnsmasq.service.old ] || cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq.service.old
1575
	[ -e /lib/systemd/system/dnsmasq.service.default ] || cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq.service.default
1575
	$SED "s?^After=.*?After=syslog.target network-online.target chilli.service?g" /lib/systemd/system/dnsmasq.service
1576
	$SED "s?^After=.*?After=syslog.target network-online.target chilli.service?g" /lib/systemd/system/dnsmasq.service
1576
# Create dnsmasq-blacklist, dnsmasq-whitelist and dnsmasq-blackhole unit
1577
# Create dnsmasq-blacklist, dnsmasq-whitelist and dnsmasq-blackhole unit
1577
	for list in blacklist whitelist blackhole
1578
	for list in blacklist whitelist blackhole
1578
	do
1579
	do
1579
		cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq-$list.service
1580
		cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq-$list.service