// ==UserScript== // @name IP Hunter by tr0janz08 // @namespace http://www.symbianize.com/showthread.php?t=1397083 // @version 3.1.2 // @description This userscript automatically reconnects the mobile data for some HUAWEI modems until it connects to a matching IP address. // @author tr0janz08 // @icon http://www.symbianize.com/images/symb_avatars/avatar456082_9.gif // @match http://192.168.8.1/html/home.html // @match http://192.168.1.1/html/home.html // @match http://192.168.254.254/html/home.html // @grant GM_info // @downloadURL none // ==/UserScript== /* * IP Hunter by tr0janz08 * http://www.symbianize.com/showthread.php?t=1397083 * * THIS WORK IS COPYRIGHT PROTECTED * http://www.copyrighted.com/copyrights/view/v6tm-qzys-ym79-9saw * * 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 SYMBIANIZE OR ON FACEBOOK. */ !function(){"use strict";$(document).ready(function(){function log(l){setTimeout(function(){var a=$("#iph-log")[0];a.value+="\n"+l,a.scrollTop=a.scrollHeight},200)}function loginToDashboard(){$("#username")[0]?($("#username").val($("#iph-username").val()),$("#password").val($("#iph-password").val())):($('').val(username).appendTo("body"),$('').val(password).appendTo("body")),login(g_destnation,function(){console.clear(),log("Login successful."),scan()}),setTimeout(function(){$(".error_message").text().length>1&&(log($(".error_message").text()),$(".error_message").hide())},300)}function scan(){log("Scanning..."),getAjaxData("api/monitoring/status",function(l){var a=xml2object(l);if("response"==a.type){var e=a.response.WanIPAddress,o=!1;e&&""!==e?(log("Current IP: "+e),$("#iph-mini-log").text(e),validIps.split(";").forEach(function(l,a){e.startsWith(l)&&(log("Matched pattern: "+l),excptIps.split(";").forEach(function(l,a){e.startsWith(l)?(log("Matches an exception pattern: "+l),$("#iph-enable-reboot")[0].checked&&e==prevIp?($("