Sponsored Content
Full Discussion: activate and deactivate
Top Forums UNIX for Advanced & Expert Users activate and deactivate Post 302108008 by sysgate on Thursday 22nd of February 2007 10:43:10 AM
Old 02-22-2007
I'm kinda confused on what exactly you are trying to achive. Is this "getbyhostname" used in Perl script ? On command line there are lots of utilites : ping, traceroute, mtr, tcptraceroute, and my favorite :
Code:
[root@sysgate ~]$ gethostip unix.com
unix.com 216.120.251.184 D878FBB8

Please explain in details.

I just found this in my archive :

Code:
#!/usr/local/bin/perl

use strict;
use warnings;

use Socket qw(AF_INET);

usage() if $#ARGV == -1;
display_info( @ARGV );

sub display_info {
  foreach (shift) {
    my ($ip, $host, $aliases, $addrtype, $length, @addrs);
    $ip = $_;
    if ( /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ ) {
      print "IP is $ip\n";
      ($host, $aliases, $addrtype, $length, @addrs) =
         gethostbyaddr( pack( 'C4', $1, $2, $3, $4 ), AF_INET );
      die "Reverse lookup failed to find name for $ip\n" unless $host;
    }
    $host = $ip unless $host;
    print "Hostname is $host\n";
    ($host, $aliases, $addrtype, $length, @addrs) = gethostbyname( $host );
    die "Lookup failed to find address for $host\n" unless @addrs;
    print "Maps to these IPs:\n";
    foreach (@addrs) {
      print "IP: ".join( '.', unpack( 'C4', $_ ) )."\n";
    }
  }
}

sub usage {
  print STDERR <<EOM;
Usage: getdnsinfo.pl <IP|host>...
Example `getdnsinfo.pl domain.com'
EOM
  exit( 0 );
}

Is it something similar that you are doing ?
 

9 More Discussions You Might Find Interesting

1. Slackware

how to activate USB mouse

:confused: I am using Linux for a while and now changed to slackware for my study and it is not as good as redhat everytime when you add this or that it needs either configure modules or recompile kernel Now I changed from PS/2 mouse to USB trouble starts it refuse to work I know I can... (3 Replies)
Discussion started by: slackware
3 Replies

2. UNIX for Dummies Questions & Answers

how do i activate php on linux....

i have activated mysql, and apache on my redhat 9 box, i went to mr BASH and wrote a php script, and it wouldn't execute. any help????????????????????????????????????? is there something that i need to activate??????? i have RUBY on there too,does it matter or no??? ... (2 Replies)
Discussion started by: mbabeli
2 Replies

3. UNIX for Dummies Questions & Answers

deactivate users

Hi all, we are running an hp-ux sd32 server with hp-ux 11.11 and i have to modify 130 users on the system, so that they are inactive. We have not installed the security package, so i cannot use usermod -e 2/24/04 qsc0017. Is there anyone who knows one command which i can use to change the user... (2 Replies)
Discussion started by: ortsvorsteher
2 Replies

4. AIX

How to activate the NTP on AIX 5.3

Hello everyone; can any help me to know how to activate the NTP on mein AIX server? The proprosal its thet 3 oder servers are synv on time. Thaks, and regards (3 Replies)
Discussion started by: GEIER
3 Replies

5. IP Networking

How to activate a network interface?

What are the steps between "ifconfig eth0 UP" and "net_device->open"? ifconfig eth0 UP => ioctl(skfd, SIOCSIFFLAGS, &ifr) (ifr.ifr_flags = IFF_UP | IFF_RUNNING) => ????? => what are these steps? net_device->open Thanks! (1 Reply)
Discussion started by: samuncle
1 Replies

6. UNIX for Advanced & Expert Users

Deactivate a user account in Solaris 10

Hi, I need to deactivate a user account for some time and then reactivate the user account ... Can anybody please help me how to do this..... I don't have root privileges but i have sudo to privileges. Thanks.... Thread closed. Double post. Continued here. (0 Replies)
Discussion started by: firestar
0 Replies

7. Solaris

Deactivate a user account in Solaris 10

Hi, I need to deactivate a user account for some time and then reactivate the user account ... Can anybody please help me how to do this..... I don't have root privileges but i have sudo to privileges. Thanks.... (3 Replies)
Discussion started by: firestar
3 Replies

8. UNIX for Dummies Questions & Answers

Unable to deactivate a Volume Group

We want to deactivate a VG but failed, because one of the LVs created there is busy. When we are trying to unmount the LV, it is telling "not mounted" and if I execute mount command it will be informing us "already mounted". dmsetup info is indicating "Open Count = 1". Please help me, how we... (5 Replies)
Discussion started by: atanubanerji
5 Replies

9. Shell Programming and Scripting

Activate and deactivate function within a ksh script

Hi, I have written a function which will blink a text "Scanning...". Now in the main script when I am doing the scan in the server I want to call this function so that user will see a blinking text on the screen and at the same time script will proceed will the scan function. Once scan is... (2 Replies)
Discussion started by: suhasingale
2 Replies
capiinit(8)						      System Manager's Manual						       capiinit(8)

NAME
capiinit - start or stop CAPI-capable ISDN cards SYNOPSIS
capiinit [OPTIONS] start | stop | show | status | prepare | reload | activate | deactivate capiinit [OPTIONS] activate|deactivate cardname capiinit [OPTIONS] activate|deactivate driver [cardname] DESCRIPTION
capiinit is called with one of the following actions: start Load all modules and initialize all cards (loading the firmware), which are configured in /etc/capi.conf. stop Reset all cards and unload modules. show Show the current configuration. status Show the current status. prepare Load all modules. activate Initialize all cards. activate cardname Initialize one card (i.e.: c4-ec00). activate driver [cardnumber] Initialize one card. deactivate Reset all cards. deactivate cardname Reset one card (i.e.: c4-ec00). deactivate driver [cardnumber] Reset one card. reload Reset all cards and initialize them again. Firmware files are searched in this order in the following directories: /usr/share/isdn/`uname -r`, /usr/share/isdn, /usr/lib/isdn, /lib/isdn. There is a sample config in /etc/capi.conf. OPTIONS
-c filename, --config filename Use filename as config file (default is /etc/capi.conf). -d, --debug Save patch values for debugging purposes. -s, --silent Don't show status information. AUTHOR
Manpage written from C source by Paul Slootman <paul@debian.org>, updated by Matthias Klose <m@klose.in-berlin.de>. capiinit(8)
All times are GMT -4. The time now is 11:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy