From f98033b32613efe34da1e7aba5e81913e9b833f4 Mon Sep 17 00:00:00 2001 From: Devops Date: Mon, 10 Jul 2017 11:35:38 +0100 Subject: [PATCH] bin/ovh-api --- bin/ovh-api | 16 +++++++++++----- www/dbq/html/default.min.css | 2 +- www/dbq/html/default.min.js | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bin/ovh-api b/bin/ovh-api index f0567419..29d9bb97 100755 --- a/bin/ovh-api +++ b/bin/ovh-api @@ -63,9 +63,15 @@ if ($Opt{'ip-routed'}) { } if ($Opt{'ip-is-routed'}) { + my %ex = ( + 'master' => 0, + 'none' => 1, + 'slave' => 2, + ); my $localhost = hostname(); #my @routed = grep { $_->[1] ne 'down' } ip_routed($Opt{'ip-is-routed'}); - my @routed = grep { $_->[0] eq $localhost } ip_routed($Opt{'ip-is-routed'}); +# NB 10.07.17 my @routed = grep { $_->[0] eq $localhost } ip_routed($Opt{'ip-is-routed'}); + my @routed = ip_routed($Opt{'ip-is-routed'}); #print $routed[0][0]."\n" and exit 0 if @routed==1 and $routed[0][0] eq $localhost; # NB 10.07.17 if (@routed==1) { @@ -73,13 +79,13 @@ if ($Opt{'ip-is-routed'}) { # NB 10.07.17 exit ( $routed[0][0] eq $localhost ? 0 : 2 ); # NB 10.07.17 } - print $_[0]."\n" and exit 0 if @_ = map {$_->[0]} grep {$_->[1] eq 'master'} @routed; + print $_[0]."\n" and exit $ex{master} if @_ = grep {$_ eq $localhost} map {$_->[0]} grep {$_->[1] eq 'master'} @routed; - print $_[0]."\n" and exit 2 if @_ = map {$_->[0]} grep {$_->[1] eq 'slave'} @routed; + print $_[0]."\n" and exit $ex{slave} if @_ = grep {$_ eq $localhost} map {$_->[0]} grep {$_->[1] eq 'slave'} @routed; - print $_[0]."\n" and exit 2 if @_ = map {$_->[0]} grep {$_->[1] eq 'down'} @routed; + print $_[0]."\n" and exit $ex{slave} if @_ = grep {$_ eq $localhost} map {$_->[0]} grep {$_->[1] eq 'down'} @routed; - exit 1; + exit $ex{none}; } # Query diff --git a/www/dbq/html/default.min.css b/www/dbq/html/default.min.css index efa9d1ef..2aaedc3c 100644 --- a/www/dbq/html/default.min.css +++ b/www/dbq/html/default.min.css @@ -1 +1 @@ -Cannot find module '..' +table,table.rows{border-collapse:collapse}.button,a,a:visited{text-decoration:none}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}h1{margin:0 0 .5em;font-size:180%;padding-bottom:.3em;border-bottom:dashed 1px #444}a{color:inherit}.button,div>a,li a,p a,td a{color:#3572B0}.button:hover,a:hover{opacity:.8}ul{padding:0;margin:0}li{list-style:none;padding:0 0 0 .3em}td,th{padding:.2em .7em}th a.sort{padding:0 .3em}input:not([type]),input[type=text],input[type=password],input[type=date],input[type=email],input[type=url],input[type=''],select,textarea{border-radius:3px;border:1px solid #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}.block,.menu,div.row,form.edit,iframe,object,pre,table.rows,ul.row{border-radius:4px;border-spacing:0;padding:.5em .2em;margin-bottom:.5em;border:1px solid #DDD;background-color:#FAFAFA;box-shadow:0 1px 2px #EEE}.rows{padding:0}table.rows{border-style:hidden;box-shadow:0 0 0 1px #DDD;table-layout:fixed}table.rows.fixed{width:100%}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}table.rows th{text-align:left}table.rows td{padding:.3em}table.rows.fixed td{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}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.row div{margin:0}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;line-height:1.5em;border-radius:4px;white-space:nowrap;box-sizing:border-box;margin:0 .1em 0 0;cursor:pointer;padding:0 .3em;border:none;background-color:#EEE;background:linear-gradient(to bottom right,#EEE,#DDD);box-shadow:0 1px 1px #BBB}.buttons,.center,.menu,.nav,.rows,td.button{margin-left:auto;margin-right:auto;display:table}form.menu{padding:.5em;background-color:#FAFAFA}form.menu .button.add{float:right;margin-top:.3ex;display:inline}form.menu .criterias{border-top:dashed 1px #DDD;margin-top:.3em;padding-top:.3em}form.menu .criterias span.label{border-right:solid 1px #fff;padding:.2em .1em;margin:.2em .2em 0 0;border-radius:3px}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]:focus{width:auto}form.menu .criterias input[type=text]{width:4em}form.edit .fields label{width:25%;text-align:right;display:inline-block;margin-right:1em;vertical-align:top}form.edit .fields .label span{width:54%;display:inline-block;text-align:left;vertical-align:middle;margin-top:.2em}form.Wedit .fields .label span input{vertical-align:bottom!important}form.edit .fields input[size],form.edit .fields select,form.edit .fields textarea{width:65%} diff --git a/www/dbq/html/default.min.js b/www/dbq/html/default.min.js index efa9d1ef..0302e723 100644 --- a/www/dbq/html/default.min.js +++ b/www/dbq/html/default.min.js @@ -1 +1 @@ -Cannot find module '..' +function form_clean(e){var t;for(i=0;i'+document.querySelector(".nav.bottom").innerHTML+""),document.querySelectorAll("table").forEach(function(e){parseInt(e.offsetWidth)>parseInt(window.innerWidth)&&(e.className=e.className.replace(/(^| +)fixed($| )/,"")+" fixed",e.className=e.className.trim())}),window._dbq.perm'+(window._dbq.perm>=window._dbq.perms.write?' ':""))})}); -- 2.47.3