9,7 → 9,6 |
# enable / disable the bypass of authentication process and WEB filtering |
|
usage="Usage: alcasar-bypass.sh {--on or -on } | {--off or -off}" |
SED="/bin/sed -i" |
CONF_FILE="/usr/local/etc/alcasar.conf" |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace |
|
25,7 → 24,7 |
echo "$usage" |
exit 0 |
;; |
--on | -on) |
--on | -on) |
/usr/local/bin/alcasar-logout.sh all |
/usr/bin/systemctl stop chilli |
cp -f /etc/sysconfig/network-scripts/bypass-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF |
34,11 → 33,7 |
DHCP=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2` |
if [ $DHCP != off ] |
then |
$SED "/^#dhcp-range=/s/^#//" /etc/dnsmasq.conf # dnsmasq become the DHCP server |
$SED "/^#dhcp-option=/s/^#//" /etc/dnsmasq.conf |
$SED "/^#domain=/s/^#//" /etc/dnsmasq.conf |
$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf |
/usr/bin/systemctl restart dnsmasq |
/usr/bin/systemctl start dhcpd |
fi |
|
rm -f /etc/cron.d/alcasar-daemon-watchdog # don't restart daemons (specially coova) |
48,11 → 43,7 |
--off | -off) |
cp -f /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF |
ifup $INTIF |
$SED "s?^dhcp-range=.*?#&?g" /etc/dnsmasq.conf # dnsmasq is no more the DHCP server (it's coova) |
$SED "s?^dhcp-option=.*?#&?g" /etc/dnsmasq.conf |
$SED "s?^domain=.*?#&?g" /etc/dnsmasq.conf |
$SED "/^#no-dhcp-interface/s/^#//" /etc/dnsmasq.conf |
/usr/bin/systemctl restart dnsmasq |
/usr/bin/systemctl stop dhcpd |
/usr/bin/systemctl start chilli |
sh /usr/local/bin/alcasar-iptables.sh |
# activation of the "daemon-watchdog" every 18' |