// ==UserScript== // @name IP Hunter for ZTE-MF6m by unel // @namespace https://greasyfork.org/en/scripts/26461-ip-hunter-by-unel // @version 1.0.1 // @description This userscript automatically reconnects the mobile data for some ZTE MF6M modems until it connects to a matching IP address. // @author unel // @match http://192.168.1.1/index.html // @grant none // @downloadURL none // ==/UserScript== /* * IP Hunter by unel * * * THIS WORK IS COPYRIGHT PROTECTED * http://www.copyrighted.com/copyrights/view/res6-lerh-sdlx-2lgh * * MODIFYING THE TOOL FOR YOUR PERSONAL USE IS PERMITTED * HOWEVER, RE-BRANDING OR REMOVING THIS COPYRIGHT NOTICE IS NOT ALLOWED. * * IF YOU HAVE ANY SUGGESTIONS TO IMPROVE THIS TOOL, * YOU CAN PM ME ON FACEBOOK. * https://www.facebook.com/lyoniel.farase */ (function() { 'use strict'; var zte_service = null; var zte_device_info = null; var zte_device_info_init = null; var valid_ip = "10.;100.12;100.13;100.14;100.15;100.16;100.17;100.18;100.19;100.2"; var hunter_handler = null; var ppp_status = null; //connected: "ppp_connected", disconnected: "ppp_disconnected" var ppp_loading = null; // Your code here... $('
').appendTo('body'); $("#txt_pattern").val(localStorage.zte_valid_ip || valid_ip); $("#btn_init").click(function(){ var valid_ip_val = $("#txt_pattern").val() || valid_ip; localStorage.zte_valid_ip = valid_ip_val; //zte_device_info_init = require.s.contexts._.defined['status\/device_info']; //zte_device_info_init.init(); zte_service = require.s.contexts._.defined.service; zte_device_info = zte_service.getDeviceInfo(); ppp_status = zte_device_info.connectStatus; if(this.value == "Search"){ $("#div_iphunt_logs").empty(); this.value = "Stop"; hunter_handler = setInterval(function(){ if(ppp_loading) return; zte_device_info = zte_service.getDeviceInfo(); var e = zte_device_info.wanIpAddress; $("#div_iphunt_logs").append("Current IP: "+ e + ""); var res_ip = false; valid_ip.split(";").forEach(function(l,a){res_ip = res_ip || e.startsWith(l);}); if(!res_ip){ $("#div_iphunt_logs").append("Reconnecting...