Subversion Repositories ALCASAR

Rev

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

Rev 1515 Rev 1517
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1515 2014-12-08 22:52:18Z richard $ 
2
#  $Id: alcasar.sh 1517 2014-12-09 23:06:31Z 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 1304... Line 1304...
1304
	      userdel -r tinyproxy 2>/dev/null
1304
	      userdel -r tinyproxy 2>/dev/null
1305
	      groupdel tinyproxy 2>/dev/null
1305
	      groupdel tinyproxy 2>/dev/null
1306
	fi
1306
	fi
1307
	groupadd -f tinyproxy
1307
	groupadd -f tinyproxy
1308
	useradd -r -g tinyproxy -s /bin/false -c "system user for tinyproxy" tinyproxy
1308
	useradd -r -g tinyproxy -s /bin/false -c "system user for tinyproxy" tinyproxy
1309
	mkdir -p /var/run/tinyproxy /var/log/tinyproxy
1309
	mkdir -p /run/tinyproxy /var/log/tinyproxy
1310
	chown -R tinyproxy:tinyproxy /var/run/tinyproxy /var/log/tinyproxy
1310
	chown -R tinyproxy.tinyproxy /run/tinyproxy /var/log/tinyproxy
1311
	[ -e /etc/tinyproxy/tinyproxy.conf.default ] || cp /etc/tinyproxy/tinyproxy.conf /etc/tinyproxy/tinyproxy.conf.default
1311
	[ -e /etc/tinyproxy/tinyproxy.conf.default ] || cp /etc/tinyproxy/tinyproxy.conf /etc/tinyproxy/tinyproxy.conf.default
1312
	$SED "s?^User.*?User tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
1312
	$SED "s?^User.*?User tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
1313
	$SED "s?^Group.*?Group tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
1313
	$SED "s?^Group.*?Group tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
1314
	$SED "s?^Port.*?Port 8090?g" /etc/tinyproxy/tinyproxy.conf			# Listen Port
1314
	$SED "s?^Port.*?Port 8090?g" /etc/tinyproxy/tinyproxy.conf			# Listen Port
1315
	$SED "s?^#Listen.*?Listen $PRIVATE_IP?g" /etc/tinyproxy/tinyproxy.conf		# Listen NIC (only intif)
1315
	$SED "s?^#Listen.*?Listen $PRIVATE_IP?g" /etc/tinyproxy/tinyproxy.conf		# Listen NIC (only intif)
Line 1332... Line 1332...
1332
After=network.target iptables.service
1332
After=network.target iptables.service
1333
 
1333
 
1334
[Service]
1334
[Service]
1335
Type=forking
1335
Type=forking
1336
User=tinyproxy
1336
User=tinyproxy
-
 
1337
ExecStartPre=/bin/chown -R tinyproxy.tinyproxy /run/tinyproxy
1337
PIDFile=/run/tinyproxy/tinyproxy.pid
1338
PIDFile=/run/tinyproxy/tinyproxy.pid
1338
ExecStart=/usr/sbin/tinyproxy -c /etc/tinyproxy/tinyproxy.conf
1339
ExecStart=/usr/sbin/tinyproxy -c /etc/tinyproxy/tinyproxy.conf
1339
 
1340
 
1340
[Install]
1341
[Install]
1341
WantedBy=multi-user.target
1342
WantedBy=multi-user.target
Line 1552... Line 1553...
1552
expand-hosts
1553
expand-hosts
1553
bogus-priv
1554
bogus-priv
1554
filterwin2k
1555
filterwin2k
1555
EOF
1556
EOF
1556
 
1557
 
-
 
1558
# the main instance should start after network and chilli (which create tun0)
-
 
1559
	[ -e /lib/systemd/system/dnsmasq.service.old ] || cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq.service.old
-
 
1560
	$SED "s?^After=.*?After=syslog.target network-online.target chilli.service?g" /lib/systemd/system/dnsmasq.service
1557
# Create dnsmasq-blacklist, dnsmasq-whitelist and dnsmasq-blackhole unit
1561
# Create dnsmasq-blacklist, dnsmasq-whitelist and dnsmasq-blackhole unit
1558
	for list in blacklist whitelist blackhole
1562
	for list in blacklist whitelist blackhole
1559
	do
1563
	do
1560
		cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq-$list.service
1564
		cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq-$list.service
1561
		$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/dnsmasq -C /etc/dnsmasq-$list.conf?g" /lib/systemd/system/dnsmasq-$list.service
1565
		$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/dnsmasq -C /etc/dnsmasq-$list.conf?g" /lib/systemd/system/dnsmasq-$list.service
1562
		$SED "s?^PIDFile=.*?PIDFile=/var/run/dnsmasq-$list.pid?g" /lib/systemd/system/dnsmasq-$list.service
1566
		$SED "s?^PIDFile=.*?PIDFile=/var/run/dnsmasq-$list.pid?g" /lib/systemd/system/dnsmasq-$list.service
1563
	done
1567
	done
1564
# the main instance should start after network and chilli (which create tun0)
-
 
1565
	[ -e /lib/systemd/system/dnsmasq.service.old ] || cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq.service.old
-
 
1566
	$SED "s?^After=.*?After=syslog.target network-online.target chilli.service?g" /lib/systemd/system/dnsmasq.service
-
 
1567
} # End dnsmasq
1568
} # End dnsmasq
1568
 
1569
 
1569
##########################################################
1570
##########################################################
1570
##		Fonction "BL"				##
1571
##		Fonction "BL"				##
1571
##########################################################
1572
##########################################################