Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

sip Samba IP

by mkmcconn (Chaplain)
on Nov 07, 2001 at 08:07 UTC ( [id://123764]=CUFP: print w/replies, xml ) Need Help??

Tiny, limited name lookup utility for linux/unix machines on Windows networks.
Ex:

 ping $(sip host)
 scp username@$(sip linuxhost):.profile ./
 lynx http://$(sip pwshost)/cgi-bin/env.pl

-n
    sip -n host,
-i
  Choose one of multiple network interfaces listening for nmb.
  Pattern-match is from left to right.
     sip -ni 192. host

#!/usr/bin/perl -w # sip - Samba IP lookup derived from nmblookup output. # Queries for names available to Samba but not DNS. use strict; use Getopt::Std; use vars qw($opt_n $opt_i); getopts('ni:'); if (! @ARGV){ print usage(); die "\n"; } my (undef,@hosts) = split (/\n/, `nmblookup $ARGV[0]`); $opt_i ||= ""; for (@hosts){ s/\S+$|\s//g; m/^$opt_i/ and print $_.($opt_n?"\n":""); } sub usage { my ($prog) = $0 =~ m!([^/]+)$!; return <<HERE ; USAGE: $0 [-i <network>] [-n] <host>: nmblookup the host to retrieve the numerical ip. Ex: \tping \$($prog host) \tscp ($ENV{'USER'}\@\$($prog linuxhost):.profile ./ \tlynx http://\$($prog pwshost)/cgi-bin/env.pl -n Print newline after output. Ex: \t$prog -n host -i Choose one of multiple network interfaces listening for nmb. Pattern-match is from left to right. \t$prog -ni 192. host HERE } __END__ ~

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://123764]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (None)
    As of 2024-04-25 01:13 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found