local url='';
for url in http://nbdom.net/myip http://nicolas.boisselier.free.fr/myip/ http://ipinfo.io/ip http://www.ipchicken.com http://icanhazip.com http://ident.me
do
- http_get "$url" 2> /dev/null | awk 'match($0, /([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/) {print substr($0, RSTART, RLENGTH); exit 64}'
- #http_get "$url" | sed -n '/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/p; q' | awk '{print $1}' | head -1
+ #http_get "$url" 2> /dev/null | awk 'match($0, /([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/) {print substr($0, RSTART, RLENGTH); exit 64}'
#http_get "$url" | perl -ne 'print "$1\n" and exit 64 if /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/';
+ http_get "$url" | sed -n '/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/p; q' | awk '{print $1; exit 64}'
+
[ "$?" == "64" ] && return 0;
done;
return 1
-html{font:90% 'Trebuchet MS',sans-serif;background-color:#eee}body{display:table;margin-left:auto;margin-right:auto;padding-left:1em;padding-right:1em;color:#444}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.loader{border:16px solid #fff;border-radius:50%;border-top:16px solid #000;padding:0;margin:0 auto 0 auto;width:8em;height:8em;animation:spin 2s linear infinite;display:block}body.loader{margin-top:8em}.loader *{display:none!important}h1{margin:0 0 .2em 0;font-size:180%;padding-bottom:.3em;margin-bottom:.5em;border-bottom:dashed 1px #444}h1 select{padding:0;border:none;background:inherit;font:inherit}a{color:inherit}div>a,li a,p a,td a{color:#3572b0}a,a:visited{text-decoration:none}.button:hover,a:hover{opacity:.8}ul{padding:0;margin:0}li{list-style:none;padding:0 0 0 .3em}table{border-collapse:collapse}td,th{padding:.2em .7em}th a.sort{float:left;margin-right:.1em}input:not([type]),input[type=''],input[type=date],input[type=email],input[type=password],input[type=text],input[type=url],select,textarea{border-radius:3px;border:solid 1px #ddd;padding:.3em .4em;box-shadow:0 1px 1px #eee}input[size]{max-width:70%}div.row div label:after,form label:after{content:':'}form input,form label,form select{vertical-align:middle;margin:.2em .4em .2em 0}.rows{padding:0}.rows form{display:inline-block}.block,.menu,div.row,form.edit,iframe,pre,table.rows,ul.row{border-radius:4px;border-spacing:0;padding:.5em .2em;margin-bottom:.5em;border:solid 1px #ddd;background-color:#fafafa;box-shadow:0 1px 2px #eee}table.rows{border-style:hidden;border-collapse:collapse;box-shadow:0 0 0 1px #ddd;table-layout:fixed}table.rows tr:nth-child(even) td{background-color:#fefefe}div.row div,table.rows td,table.rows th,ul.row li{border-bottom:solid 1px #ddd}div.row div,table.rows tr:last-child td,ul.row li{border-bottom:none}table.rows td,table.rows th{border-right:dashed 1px #ddd}.rows .count{text-align:right}table.rows th{text-align:left}table.rows td{padding:.3em .3em}table.rows.fixed{width:100%}div.row div label,table.rows.fixed td,table.rows.fixed th{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}table.rows.fixed th{white-space:normal}table.rows td.delete,table.rows td.view{width:1%;white-space:nowrap}table.rows.fixed th.view{width:2em}table.rows.fixed th.delete{width:2.7em}div.rows{clear:both}div.row{float:left;margin-right:4px;min-width:24%}.nofloat{float:none}div.row div{margin:0;padding:.1em .2em;border-bottom:solid 1px #fff}.rows .row img{height:1.2em}div.row div.view .button{margin-bottom:5px}div.row div.delete .button{margin-top:5px}div.row div:last-child{border-bottom:none;padding-bottom:0}div.row div.delete label,div.row div.view label{display:none}div.row div.delete,div.row div.view{text-align:center}div.row div label,ul.row li label{padding:.1em .5em .1em 0;min-width:20%;display:inline-block}.button{font:inherit;display:inline-block;text-decoration:none;line-height:1.6em;cursor:pointer;white-space:nowrap;box-sizing:border-box;margin:0 .1em 0 0;padding:0 .3em;border-radius:4px;border:none;color:#3572b0;background-color:#eee;background:linear-gradient(to bottom right,#eee,#ddd);box-shadow:0 1px 1px #bbb}.bottom,.center,.menu,.nav,.rows{clear:both;display:table}.bottom,.buttons,.center,.menu,.nav,.rows,td.button{margin-left:auto;margin-right:auto}div.buttons{text-align:center;margin-top:.5em}form.menu{padding:.5em;background-color:#fafafa;max-width:1024px}form.menu .button.add{float:right;margin-top:.2em}form.menu .criterias{border-top:dashed 1px #ddd;margin-top:.3em;padding-top:.3em;clear:both}form.menu .criterias span.label{border-right:solid 1px #fff;border-radius:3px;margin:0 .2em;white-space:nowrap;float:left}form.menu .criterias span.label:last-child{border-right:none}form.menu select:focus{max-width:auto}form.menu select{max-width:20%}form.menu .criterias input[type=text]{width:4em}div.row label,form.edit .fields label{width:25%;text-align:right;display:inline-block;margin-right:1em;vertical-align:top}div.row .label span,form.edit .fields .label span{width:54%;display:inline-block;text-align:left;vertical-align:middle;margin-top:.2em}form.edit .fields input[size],form.edit .fields select,form.edit .fields textarea{width:65%}form.edit .fields img{max-height:90px}
+html{font:90% 'Trebuchet MS', sans-serif;background-color:#EEEEEE}body{display:table;margin-left:auto;margin-right:auto;padding-left:1em;padding-right:1em;color:#444444}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg); }}.loader{border:16px solid #FFFFFF;border-radius:50%;border-top:16px solid #000000;padding:0;margin:0 auto 0 auto;width:8em;height:8em;animation:spin 2s linear infinite;display:block}body.loader{margin-top:8em}.loader*{display:none !important}h1{margin:0 0 0.2em 0;font-size:180%;padding-bottom:0.3em;margin-bottom:0.5em;border-bottom:dashed 1px #444444}h1 select{padding:0;border:none;background:inherit;font:inherit}a{color:inherit}p a,div>a,li a,td a{color:#3572B0}a,a:visited{text-decoration:none}a:hover,.button:hover{opacity:0.8}ul{padding:0;margin:0}li{list-style:none;padding:0 0 0 0.3em}table{border-collapse:collapse}td,th{padding:0.2em 0.7em}th a.sort{float:left;margin-right:0.1em}textarea,select,input:not([type]),input[type='text'],input[type='password'],input[type='date'],input[type='email'],input[type='url'],input[type='']{border-radius:3px;border:solid 1px #DDDDDD;padding:0.3em 0.4em;box-shadow:0px 1px 1px #EEEEEE}input[size]{max-width:70%}div.row div label:after,form label:after{content:':'}form label,form input,form select{vertical-align:middle;margin:0.2em 0.4em 0.2em 0}.rows{padding:0}.rows form{display:inline-block}table.rows,div.row,ul.row,form.edit,.menu,.block,iframe,pre{border-radius:4px;border-spacing:0;padding:0.5em 0.2em;margin-bottom:0.5em;border:solid 1px #DDDDDD;background-color:#FAFAFA;box-shadow:0px 1px 2px #EEEEEE}table.rows{border-style:hidden;border-collapse:collapse;box-shadow:0 0 0 1px #DDDDDD;table-layout:fixed}table.rows tr:nth-child(even)td{background-color:#FEFEFE}ul.row li,div.row div,table.rows th,table.rows td{border-bottom:solid 1px #DDDDDD}ul.row li,div.row div,table.rows tr:last-child td{border-bottom:none}table.rows th,table.rows td{border-right:dashed 1px #DDDDDD}.rows.count{text-align:right}table.rows th{text-align:left}table.rows td{padding:0.3em 0.3em}table.rows.fixed{width:100%}table.rows.fixed th,table.rows.fixed td,div.row div label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}table.rows.fixed th{white-space:normal}table.rows td.view,table.rows td.delete{width:1%;white-space:nowrap}table.rows.fixed th.view{width:2em}table.rows.fixed th.delete{width:2.7em}div.rows{clear:both}div.row{float:left;margin-right:4px;min-width:24%}.nofloat{float:none}div.row div{margin:0;padding:0.1em 0.2em;border-bottom:solid 1px #fff}.rows.row img{height:1.2em}div.row div.view.button{margin-bottom:5px}div.row div.delete.button{margin-top:5px}div.row div:last-child{border-bottom:none;padding-bottom:0}div.row div.view label,div.row div.delete label{display:none}div.row div.view,div.row div.delete{text-align:center}div.row div label,ul.row li label{padding:0.1em 0.5em 0.1em 0;min-width:20%;display:inline-block}.button{font:inherit;display:inline-block;text-decoration:none;line-height:1.6em;cursor:pointer;white-space:nowrap;box-sizing:border-box;margin:0 0.1em 0 0;padding:0 0.3em;border-radius:4px;border:none;color:#3572B0;background-color:#EEEEEE;background:linear-gradient(to bottom right, #EEEEEE, #DDDDDD);box-shadow:0px 1px 1px #BBBBBB}.menu,.nav,.rows,.bottom,.center{clear:both;display:table}.menu,.nav,.rows,.bottom,.buttons,td.button,.center{margin-left:auto;margin-right:auto}div.buttons{text-align:center;margin-top:0.5em}form.menu{padding:0.5em;background-color:#FAFAFA;max-width:1024px}form.menu.button.add{float:right;margin-top:0.2em}form.menu.criterias{border-top:dashed 1px #DDDDDD;margin-top:0.3em;padding-top:0.3em;clear:both}form.menu.criterias span.label{border-right:solid 1px #fff;border-radius:3px;margin:0 0.2em;white-space:nowrap;float:left}form.menu.criterias span.label:last-child{border-right:none}form.menu select:focus{max-width:auto}form.menu select{max-width:20%}form.menu.criterias input[type=text]{width:4em}div.row label,form.edit.fields label{width:25%;text-align:right;display:inline-block;margin-right:1em;vertical-align:top}div.row.label span,form.edit.fields.label span{width:54%;display:inline-block;text-align:left;vertical-align:middle;margin-top:0.2em}form.edit.fields input[size],form.edit.fields textarea,form.edit.fields select{width:65%}form.edit.fields img{max-height:90px}
+document.addEventListener("DOMContentLoaded",function(){NodeList.prototype.forEach=Array.prototype.forEach;var ext=(window._dbq['param.format']?'.'+window._dbq['param.format']:'');if(ext=='.'+window._dbq['default.format'])ext='';document.querySelectorAll("form").forEach(function(e){e.onsubmit=function(){if(this.elements['limit']){var limit=this.elements['limit'];if(window._dbq['default_limit']!='undefined'&&limit.value==window._dbq['default_limit'])limit.removeAttribute("value");}
+return form_submit_clean(this);};});document.querySelectorAll("form.menu").forEach(function(form){form.setAttribute('action',window.location.toString().replace(/\?.*$/,''));form.querySelectorAll("form.menu select.format").forEach(function(e){e.removeAttribute('name');e.onchange=function(){this.form.setAttribute('action',window._dbq['table.base']+'.'+this.value);return this.form.onsubmit();}});form.querySelectorAll("form.menu select.tables").forEach(function(e){e.removeAttribute('name');e.onchange=function(){this.form.setAttribute('action',window._dbq['db.base']+'/'+this.value+ext);form_clean(this.form);return this.form.onsubmit();}});form.querySelectorAll("form.menu select.limit").forEach(function(e){e.onchange=function(){return this.form.onsubmit();};});});if(document.querySelector(".nav.bottom")&&document.querySelector("table.rows")){document.querySelector("table.rows").insertAdjacentHTML("beforebegin",""
++"<div class=\"nav top\">"+document.querySelector(".nav.bottom").innerHTML+"</div>");}
+document.querySelectorAll("table").forEach(function(e){if(parseInt(e.offsetWidth)>parseInt(window.innerWidth)){e.className=e.className.replace(/(^| +)fixed($| )/,'')+' fixed'
+e.className=e.className.trim();}});if(window._dbq['perm']<window._dbq['perms']['write']){document.querySelectorAll("form.edit").forEach(function(e){e.setAttribute('onsubmit','return false');});document.querySelectorAll("form.edit input[type=submit],form.edit input[type=reset]").forEach(function(e){e.setAttribute('style','display:none');});}
+document.querySelectorAll("form.menu input[type=submit]").forEach(function(e){e.insertAdjacentHTML("afterend",''
++' <input type="button" class="clear '+e.className+'" onclick="form_clean(this.form)"'
++' value="'+window._dbq['text.clear']+'"'
++' />'
++(window._dbq['perm']>=window._dbq['perms']['write']?' <input type="button" class="add '+e.className+'"'
++' onclick="window.location=\''+window._dbq['table.base']+'/add/\'"'
++' value="'+window._dbq['text.add']+'"/>':''));});if(document.querySelector("th.delete")){var a=document.createElement('a');a.setAttribute('href','#');a.innerHTML=document.querySelector("th.delete").innerHTML;document.querySelector("th.delete").innerHTML='';a.onclick=function(){var forms=document.querySelectorAll("form.rm");var elem=document.querySelector(".rows")?document.querySelector(".rows"):'';elem.className='loader';for(j=0;j<forms.length;++j){var f=forms[j];var url=f.getAttribute('action');var params=[];var items=f.getElementsByTagName('input');for(i=0;i<items.length;++i){var e=items[i];params.push(e.name+'='+encodeURI(e.value));}
+var xhttp=new XMLHttpRequest();xhttp.open("POST",url,true);xhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhttp.onload=function(e){if(xhttp.readyState===4){if(j!=forms.length)return;location.reload();}}
+xhttp.send(params.join('&'));}
+return false;};document.querySelector("th.delete").appendChild(a);}
+if(document.querySelector("body.no-db"))document.querySelectorAll("body > h1 a.db, body > h1 a.table").forEach(function(e){var base=window._dbq[e.className+'.base'].replace(/\/[^\/]+$/,'');var url=base+(base==''?'/ls':'')+'.json';var fields=e.className=='db'?['id','id']:['name','name'];dbqGet(url,function(o){var s=o.select(fields[0],fields[1],window._dbq['param.'+e.className]);s.onchange=function(){window.location=base+'/'+this.value+ext;};var crit=document.getElementById(e.className);if(crit)crit.parentNode.style.display='none';s.className=e.className;e.parentNode.replaceChild(s,e);});});});function form_clean(form){var e;for(i=0;i<form.length;i++){e=form.elements[i];if(e.style.display=="none")continue;if(e.type=="text"){e.value="";}else if(e.type.match(/^select/)&&(0||e.name=='limit'||e.name=='format')){e.selectedIndex=0;}}}
+function form_submit_clean(f){var i=0;var url="";var action=f.getAttribute("action");var method=f.getAttribute("method");if(method!="get")return true;for(i=0;i<f.length;i++){var p=f[i];if(!p.name)continue;if(p.value=="")continue;if(p.value=="undefined")continue;url+=(url?"&":"?")+encodeURI(p.name)+"="+encodeURI(p.value);}
+url=(action=="?"?"":action)+url;f.reset();window.location=url;return false;}
+function dbqGet(url,callback){var xhttp=new XMLHttpRequest();delete window._dbq['dbqGet'];xhttp.open("GET",url,true);xhttp.onload=function(e){if(xhttp.readyState===4){var obj={'rows':JSON.parse(xhttp.responseText),'debug':function(){console.log(obj.rows);},'select':function(k,v,sel='undefined'){var select=document.createElement('select');obj['rows'].forEach(function(row){var keys=Object.keys(row);var opt=document.createElement('option');opt.value=row[k];opt.innerHTML=dbqPrettyText(row[v]);select.appendChild(opt);});if(sel!='undefined')select.value=sel;return select;},};if(!callback)return(window._dbq['dbqGet']=obj);if(typeof callback=="function")return callback(obj);if(typeof callback=="string"&&callback in obj){if(typeof obj[callback]=="function")return obj[callback](obj);return obj[callback];}}};xhttp.send();}
+function dbqPrettyText(str){str=str.replace(/(\b\w)/g,function(m){return m.toUpperCase();});str=str.replace(/[^a-zA-Z0-9]+/g,' ');return str;}