Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-bypass.sh 1574 2015-03-01 23:17:07Z richard $
|
2 |
# $Id: alcasar-bypass.sh 1609 2015-04-06 08:54:37Z franck $
|
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 29... |
Line 29... |
29 |
/usr/local/sbin/alcasar-logout.sh all
|
29 |
/usr/local/sbin/alcasar-logout.sh all
|
30 |
/usr/bin/systemctl stop chilli
|
30 |
/usr/bin/systemctl stop chilli
|
31 |
cp -f /etc/sysconfig/network-scripts/bypass-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
|
31 |
cp -f /etc/sysconfig/network-scripts/bypass-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
|
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`
|
- |
|
35 |
if [ DHCP != off ] then {
|
34 |
$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf # dnsmasq become the DHCP server
|
36 |
$SED "s?^#route.*?&?g" /etc/dnsmasq.conf # dnsmasq become the DHCP server
|
- |
|
37 |
$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf #
|
35 |
/usr/bin/systemctl restart dnsmasq
|
38 |
/usr/bin/systemctl restart dnsmasq
|
- |
|
39 |
}
|
- |
|
40 |
|
36 |
rm -f /etc/cron.d/alcasar-daemon-watchdog # don't restart daemons (specially coova)
|
41 |
rm -f /etc/cron.d/alcasar-daemon-watchdog # don't restart daemons (specially coova)
|
37 |
echo "ALCASAR est en mode 'bypass'"
|
42 |
echo "ALCASAR est en mode 'bypass'"
|
38 |
echo "ALCASAR is in 'bypass' mode"
|
43 |
echo "ALCASAR is in 'bypass' mode"
|
39 |
;;
|
44 |
;;
|
40 |
--off | -off)
|
45 |
--off | -off)
|
41 |
cp -f /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
|
46 |
cp -f /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
|
42 |
ifup $INTIF
|
47 |
ifup $INTIF
|
- |
|
48 |
$SED "s?^route.*?#&?g" /etc/dnsmasq.conf #
|
43 |
$SED "s?^#no-dhcp-interface=$INTIF?no-dhcp-interface=$INTIF?g" /etc/dnsmasq.conf
|
49 |
$SED "s?^#no-dhcp-interface=$INTIF?no-dhcp-interface=$INTIF?g" /etc/dnsmasq.conf
|
44 |
$SED "s?^#no-dhcp-interface=tun0?no-dhcp-interface=tun0?g" /etc/dnsmasq.conf
|
50 |
$SED "s?^#no-dhcp-interface=tun0?no-dhcp-interface=tun0?g" /etc/dnsmasq.conf
|
45 |
$SED "s?^#no-dhcp-interface=lo?no-dhcp-interface=lo?g" /etc/dnsmasq.conf
|
51 |
$SED "s?^#no-dhcp-interface=lo?no-dhcp-interface=lo?g" /etc/dnsmasq.conf
|
46 |
/usr/bin/systemctl restart dnsmasq
|
52 |
/usr/bin/systemctl restart dnsmasq
|
47 |
/usr/bin/systemctl start chilli
|
53 |
/usr/bin/systemctl start chilli
|