if ($Opt{'ip-routed'}) {
my @routed = ip_routed($Opt{'ip-routed'});
print JSON::encode_json(\@routed);
+ require Sys::Hostname;
+ my $localhost = Sys::Hostname::hostname();
exit 0;
}
+if ($Opt{'ip-is-routed'}) {
+ my @routed = ip_routed($Opt{'ip-is-routed'});
+ require Sys::Hostname;
+ my $localhost = Sys::Hostname::hostname();
+ exit ! grep {$_ eq $localhost} @routed;
+}
# Query
help() unless @ARGV;
option[ip-move=s] Move IP to local
option[ip-routed=s] Print where is routed an ip
+ option[ip-is-routed=s] Exit 0 if ip is routed to this host
option[sql] Produce sql to update a database
option[verbose|v+] Verbose mode: increase the verbosity level.