Ver las NORMAS de estos Foros Web ZackYFileS Chat ZackYFileS Agregar a Favoritos Contactar con Administrador
 
 

TU PUBLICIDAD AQUÍ!!
Navegación
Retroceder   Foros ZackYFileS >
ESTUDIO de SISTEMAS SAT:
> SHARING - I+D y Pruebas
Nombre de usuario
Contraseña
Configuración de UsuarioAyuda (FAQs)Nuevos PostsBuscar


Respuesta
 
Herramientas
Antiguo 01/02/2014, 15:48   #1
††LUCIFER††
Invitado
 
Mensajes: n/a

script comprobación internet, reinicio emu

Lo hice sobre oscam, aunque válido para cualquier emu, en caso que lo queramos utilizar para en caso de desconexion internet pues cuando vuelva la conexion automáticamente nos reinicie la emu:

El script hace:

a) comprueba si hay conexion a internet

b) Si hay no hace nada, entra en bucle comprobando cada cierto tiempo la conexion mediante ping

c) si se pierde, no hace nada, sigue el bucle comprobando cada cierto tiempo la conexion mediante ping

d) cuando vuelve la conexion, mata oscam y lo vuelve a arrancar(o la emu que queramos poner) y se vuelve al bucle de comprobacion internet

Aqui vemos el log del proceso del script:

[CODE]dhcppc0:/usr/script# sh test.shSi hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
ping: bad address 'www.google.es'
sh: 1: unknown operand
No hay internet, esperamos que vuelva
ping: bad address 'www.google.es'
sh: 1: unknown operand
No hay internet todavia
Ya hay Internet, reiniciamos oscam
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
Si hay Internet
[/CODE]

Y aqui el script para ser utilizado:

[CODE]#!/bin/sh


while [ true ];
do
CUENTA=$(ping -c 1 www.google.es | grep received | awk -F ',' '{print $2}' | awk -F ' ' '{print $1}')
if [ $CUENTA = 1 ];then
echo "Si hay Internet"
else
echo "No hay internet, esperamos que vuelva"
INTERNET="NO"
while [ $INTERNET = NO ];
do
CUENTA=$(ping -c 1 www.google.es | grep received | awk -F ',' '{print $2}' | awk -F ' ' '{print $1}')
if [ $CUENTA = 1 ];then
echo "Ya hay Internet, reiniciamos oscam"
INTERNET="SI"
killall -9 oscam
sleep 1
/var/emu/oscam -b -c /var/etc/oscam
else
echo "No hay internet todavia"
fi
done
fi
sleep 5
done


[/CODE]

sleep 5---> el tiemp en segundos cada cuanto tiempo queremos que se ejecute

Respuesta rápida a este mensaje
Responder Citando Subir
Antiguo 01/02/2014, 16:49   #2
3usAttcK
Baneado
 
Fecha de ingreso: 31/oct/2013
Mensajes: 2.885
3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso3usAttcK tiene motivos para estar orgulloso
Este script me lo guardo

Saludos 3usAttcK.
3usAttcK está desconectado
Respuesta rápida a este mensaje
Responder Citando Subir
Publicidad: Conoce las ofertas de ANUNCIATE
Respuesta


Usuarios viendo actualmente este tema: 1 (0 usuarios registrados y 1 visitantes)
 

Permisos para publicar mensajes
No puedes crear nuevos temas
No puedes responder mensajes
No puedes subir archivos adjuntos
No puedes editar tus mensajes

Los BB code están Activado
Los Emoticones están Activado
El código [IMG] está Activado
El Código HTML está Activado

Ir al foro

Temas similares
Tema Autor Foro Resp. Último mensaje
Boletines de seguridad Microsoft Feb07 caminero21 SOFTWARE del PC - PROGRAMAS y S.O. 0 17/02/2007 01:55
Denegación de servicio en Internet Explorer (ActiveX) caminero21 SOFTWARE del PC - PROGRAMAS y S.O. 0 04/02/2007 20:50
Internet Explorer 7 final en español kolmo7 INTERNET: Navegadores, ADSL, etc. 28 16/11/2006 23:05


!! ADVERTENCIAS !!: Las informaciones aquí publicadas NO CONTIENEN KEYS para la decodificación de ningún sistema: NO SON OPERATIVOS en sistemas SAT que precisen de su correspondiente suscripción.

ESTA TOTALMENTE PROHIBIDO EL USO DE ESTAS INFORMACIONES PARA LA MODIFICACIÓN O  DEFRAUDACIÓN DE SISTEMAS DE ACCESO CONDICIONAL.

ESTOS FOROS SON MODERADOS Y NO SE PERMITE LA PUBLICACIÓN DE INFORMACIONES ILEGALES POR PARTE DE LOS USUARIOS. EN CASO DE DETECTARSE ESTE TIPO DE INFORMACIONES, LOS USUARIOS SERÁN EXCLUIDOS DE ESTAS PÁGINAS.

USO DE COOKIES: Utilizamos COOKIES y de terceros para mejorar nuestros servicios y navegación por la web. Si continua navegando, consideramos que acepta su uso.  


La franja horaria es GMT +2. Ahora son las 20:06.


-------------------------------------------------------------------- --------------------------------------------------------------------

Powered por vBulletin™ Version 3.8.10
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.
Traducido por vBsoporte - vBulletin en español
Hispaservicios - J.G.C - 29112549T - Rio Cinca, 2, 30 (50180) SPAIN.
Todos los derechos reservados. Prohibida cualquier reproducion total o parcial.


Foros Patrocinados por anunciantes.