Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-bypass.sh 1827 2016-04-19 09:47:29Z raphael.pion $
|
2 |
# $Id: alcasar-bypass.sh 1888 2016-05-12 21:53:44Z richard $
|
3 |
|
3 |
|
4 |
# alcasar-bypass.sh
|
4 |
# alcasar-bypass.sh
|
5 |
# by 3abtux and Rexy
|
5 |
# by 3abtux and Rexy
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
|
7 |
|
Line 32... |
Line 32... |
32 |
ifup $INTIF
|
32 |
ifup $INTIF
|
33 |
sh /usr/local/bin/alcasar-iptables-bypass.sh
|
33 |
sh /usr/local/bin/alcasar-iptables-bypass.sh
|
34 |
DHCP=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
|
34 |
DHCP=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
|
35 |
if [ $DHCP != off ]
|
35 |
if [ $DHCP != off ]
|
36 |
then
|
36 |
then
|
37 |
$SED "s?^#route.*?&?g" /etc/dnsmasq.conf # dnsmasq become the DHCP server
|
37 |
$SED "/^#dhcp-range/s/^#//" /etc/dnsmasq.conf # dnsmasq become the DHCP server
|
- |
|
38 |
$SED "/^#dhcp-option/s/^#//" /etc/dnsmasq.conf
|
38 |
$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf #
|
39 |
$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf
|
39 |
/usr/bin/systemctl restart dnsmasq
|
40 |
/usr/bin/systemctl restart dnsmasq
|
40 |
fi
|
41 |
fi
|
41 |
|
42 |
|
42 |
rm -f /etc/cron.d/alcasar-daemon-watchdog # don't restart daemons (specially coova)
|
43 |
rm -f /etc/cron.d/alcasar-daemon-watchdog # don't restart daemons (specially coova)
|
43 |
echo "ALCASAR est en mode 'bypass'"
|
44 |
echo "ALCASAR est en mode 'bypass'"
|
44 |
echo "ALCASAR is in 'bypass' mode"
|
45 |
echo "ALCASAR is in 'bypass' mode"
|
45 |
;;
|
46 |
;;
|
46 |
--off | -off)
|
47 |
--off | -off)
|
47 |
cp -f /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
|
48 |
cp -f /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
|
48 |
ifup $INTIF
|
49 |
ifup $INTIF
|
49 |
$SED "s?^route.*?#&?g" /etc/dnsmasq.conf #
|
50 |
$SED "s?^dhcp-range.*?#&?g" /etc/dnsmasq.conf # dnsmasq is no more the DHCP server (it's coova)
|
50 |
$SED "s?^#no-dhcp-interface=$INTIF?no-dhcp-interface=$INTIF?g" /etc/dnsmasq.conf
|
- |
|
51 |
$SED "s?^#no-dhcp-interface=tun0?no-dhcp-interface=tun0?g" /etc/dnsmasq.conf
|
51 |
$SED "s?^dhcp-option.*?#&?g" /etc/dnsmasq.conf # dnsmasq is no more the DHCP server (it's coova)
|
52 |
$SED "s?^#no-dhcp-interface=lo?no-dhcp-interface=lo?g" /etc/dnsmasq.conf
|
52 |
$SED "/#no-dhcp-interface/s/^#//" /etc/dnsmasq.conf
|
53 |
/usr/bin/systemctl restart dnsmasq
|
53 |
/usr/bin/systemctl restart dnsmasq
|
54 |
/usr/bin/systemctl start chilli
|
54 |
/usr/bin/systemctl start chilli
|
55 |
sh /usr/local/bin/alcasar-iptables.sh
|
55 |
sh /usr/local/bin/alcasar-iptables.sh
|
56 |
# activation of the "daemon-watchdog" every 18'
|
56 |
# activation of the "daemon-watchdog" every 18'
|
57 |
cat << EOF > /etc/cron.d/alcasar-daemon-watchdog
|
57 |
cat << EOF > /etc/cron.d/alcasar-daemon-watchdog
|