mkdir /partition/scripts
STATUS="UP"
#!/bin/sh
# /partition/scripts/./statusisp.sh > /dev/null 2>&1 &
#
. /partition/scripts/statusisp.conf
sleep 30
while [ 1 ] ; do
FECHA=`date`
ping -c 10 google.com
if [ $? -gt 0 ]; then
echo "Internet DOWN! -- $FECHA"
. /partition/scripts/statusisp.conf
if [ $STATUS = "UP" ]; then
echo STATUS=\"DOWN\" > /partition/scripts/statusisp.conf;
#< AQUI EL COMANDO PARA ACTIVAR EL PORTAL >
fi
else
echo "Internet UP! -- $FECHA"
. /partition/scripts/statusisp.conf
if [ $STATUS = "DOWN" ]; then
echo STATUS=\"UP\" > /partition/scripts/statusisp.conf;
#< AQUI EL COMANDO PARA DESACTIVAR EL PORTAL >
fi
fi
sleep 120
done
/partition/scripts/./statusisp.sh > /dev/null 2>&1 &
#!/bin/sh
# /partition/scripts/./statusisp.sh > /dev/null 2>&1 &
#
. /partition/scripts/statusisp.conf
sleep 30
while [ 1 ] ; do
FECHA=`date`
ping -c 10 google.com
if [ $? -gt 0 ]; then
echo "Internet DOWN! -- $FECHA"
. /partition/scripts/statusisp.conf
if [ $STATUS = "UP" ]; then
echo STATUS=\"DOWN\" > /partition/scripts/statusisp.conf;
#< AQUI EL COMANDO PARA ACTIVAR EL PORTAL >
. /etc/coyote/coyote.conf
echo "GLOB=\"ACTIVO\"" > /argentoqos/status_global
/usr/sbin/iptables -t nat -A PREROUTING -i $IF_LOCALBR -p tcp -s ! $IP_EXC -j DNAT --to-destination $LOCAL_IPADDR:942
for i in `cat /argentoqos/simple_id`; do
IP=`echo $i | cut -d "|" -f 4`
CONTROLM=`echo $i | cut -d "|" -f 5`
MAC=`echo $i | cut -d "|" -f 6`
if [ "$CONTROLM" = "mac_yes" ] ; then
/usr/sbin/iptables -t nat -D PREROUTING -i $IF_LOCALBR -p tcp -s $IP --match mac --mac-source $MAC -j RETURN
/usr/sbin/iptables -t nat -A PREROUTING -i $IF_LOCALBR -p tcp -s $IP --match mac --mac-source $MAC -j RETURN
else
/usr/sbin/iptables -t nat -D PREROUTING -i $IF_LOCALBR -p tcp -s $IP -j RETURN
/usr/sbin/iptables -t nat -A PREROUTING -i $IF_LOCALBR -p tcp -s $IP -j RETURN
fi
done
/usr/sbin/iptables -t nat -D PREROUTING -i $IF_LOCALBR -p tcp -s ! $IP_EXC -j DNAT --to-destination $LOCAL_IPADDR:941
/usr/sbin/iptables -t nat -A PREROUTING -i $IF_LOCALBR -p tcp -s ! $IP_EXC -j DNAT --to-destination $LOCAL_IPADDR:941
/bin/cp /argentoqos/http/global/cgi-bin/index2.cgi /argentoqos/http/global/cgi-bin/index.cgi
/bin/cp /argentoqos/http/intrusos/cgi-bin/index.cgi /argentoqos/http/intrusos/cgi-bin/index2.cgi
touch /tmp/need.save
fi
else
echo "Internet UP! -- $FECHA"
. /partition/scripts/statusisp.conf
if [ $STATUS = "DOWN" ]; then
echo STATUS=\"UP\" > /partition/scripts/statusisp.conf;
#< AQUI EL COMANDO PARA DESACTIVAR EL PORTAL >
#. /etc/coyote/coyote.conf
/bin/cp /argentoqos/http/intrusos/cgi-bin/index.cgi /argentoqos/http/intrusos/cgi-bin/index2.cgi
/bin/cp /argentoqos/http/global/cgi-bin/index2.cgi /argentoqos/http/global/cgi-bin/index.cgi
/argentoqos/qosbr reload
touch /tmp/need.save
fi
fi
sleep 120
done
a2machiste escreveu:tienes mucha razon cuando se cae el internet no funciona habrá alguna forma?
Voltar para Serie de add-ons Argento
Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante