Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1513 2014-12-02 10:33:11Z richard $
|
2 |
# $Id: alcasar.sh 1514 2014-12-08 20:58:01Z 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
|
1309 |
mkdir -p /var/run/tinyproxy /var/log/tinyproxy
|
1310 |
chown tinyproxy:tinyproxy /var/run/tinyproxy
|
1310 |
chown tinyproxy:tinyproxy /var/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 1550... |
Line 1550... |
1550 |
expand-hosts
|
1550 |
expand-hosts
|
1551 |
bogus-priv
|
1551 |
bogus-priv
|
1552 |
filterwin2k
|
1552 |
filterwin2k
|
1553 |
EOF
|
1553 |
EOF
|
1554 |
|
1554 |
|
1555 |
# Start after chilli (which create tun0)
|
- |
|
1556 |
$SED "s?^After=.*?After=syslog.target network.target chilli.service?g" /lib/systemd/system/dnsmasq.service
|
- |
|
1557 |
# Create dnsmasq-blacklist, dnsmasq-whitelist and dnsmasq-blackhole unit
|
1555 |
# Create dnsmasq-blacklist, dnsmasq-whitelist and dnsmasq-blackhole unit
|
1558 |
for list in blacklist whitelist blackhole
|
1556 |
for list in blacklist whitelist blackhole
|
1559 |
do
|
1557 |
do
|
1560 |
cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq-$list.service
|
1558 |
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
|
1559 |
$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
|
1560 |
$SED "s?^PIDFile=.*?PIDFile=/var/run/dnsmasq-$list.pid?g" /lib/systemd/system/dnsmasq-$list.service
|
1563 |
done
|
1561 |
done
|
- |
|
1562 |
# the main instance should start after network and chilli (which create tun0)
|
- |
|
1563 |
[ -e /lib/systemd/system/dnsmasq.service.old ] || cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq.service.old
|
- |
|
1564 |
$SED "s?^After=.*?After=syslog.target network-online.target chilli.service?g" /lib/systemd/system/dnsmasq.service
|
1564 |
} # End dnsmasq
|
1565 |
} # End dnsmasq
|
1565 |
|
1566 |
|
1566 |
##########################################################
|
1567 |
##########################################################
|
1567 |
## Fonction "BL" ##
|
1568 |
## Fonction "BL" ##
|
1568 |
##########################################################
|
1569 |
##########################################################
|