17,13 → 17,13 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace |
private_ip_mask=`grep PRIVATE_IP= $CONF_FILE|cut -d"=" -f2` |
private_ip_mask=${private_ip_mask:=192.168.182.1/24} |
PRIVATE_IP=`echo "$private_ip_mask" |cut -d"/" -f1` # @ip du portail (côté LAN) |
PRIVATE_IP=`echo "$private_ip_mask" |cut -d"/" -f1` # @ip du portail (côté LAN) |
PRIVATE_IP=${PRIVATE_IP:=192.168.182.1} |
current_users_file="/var/tmp/havp/current_users.txt" # file containing active users with their "status.php" tab open |
current_users_file="/var/tmp/havp/current_users.txt" # file containing active users with their "status.php" tab open |
DIR_WEB="/var/www/html" |
Index_Page="$DIR_WEB/index.php" |
IPTABLES="/sbin/iptables" |
TUNIF="tun0" # listen device for chilli daemon |
TUNIF="tun0" # listen device for chilli daemon |
OLDIFS=$IFS |
IFS=$'\n' |
|
42,10 → 42,10 |
/bin/sed -i "s?diagnostic =.*?diagnostic = \"can't contact the default router\";?g" $Index_Page |
;; |
esac |
net_pb=`grep "network_pb = True;" $Index_Page|wc -l` |
net_pb=`grep "network_pb = true;" $Index_Page|wc -l` |
if [ $net_pb = "0" ] # user alert (only the first time) |
then |
/bin/sed -i "s?^\$network_pb.*?\$network_pb = True;?g" $Index_Page |
/bin/sed -i "s?^\$network_pb.*?\$network_pb = true;?g" $Index_Page |
$IPTABLES -I PREROUTING -t nat -i $TUNIF -p udp --dport domain -j REDIRECT --to-port 56 |
fi |
} |
82,10 → 82,10 |
# else switch in normal mode |
else |
echo "Internet access is OK for now" |
net_pb=`grep "network_pb = True;" $Index_Page|wc -l` |
net_pb=`grep "network_pb = true;" $Index_Page|wc -l` |
if [ $net_pb != "0" ] |
then |
/bin/sed -i "s?^\$network_pb.*?\$network_pb = False;?g" $Index_Page |
/bin/sed -i "s?^\$network_pb.*?\$network_pb = false;?g" $Index_Page |
$IPTABLES -D PREROUTING -t nat -i $TUNIF -p udp --dport domain -j REDIRECT --to-port 56 |
fi |
fi |