Sponsored Content
Top Forums Shell Programming and Scripting Script to Proceed to the Next IP if the current IP hangs Post 303004740 by alvinoo on Saturday 7th of October 2017 11:55:52 PM
Old 10-08-2017
Script to Proceed to the Next IP if the current IP hangs

Hi there,

Say I have a list of IPs, I am running scripts on them. If the process hang.
I want to continue with the rest of the IPs.

Code:
10.11.1.1
10.11.1.2
10.11.1.3
10.11.1.4
10.11.1.5
10.11.1.6 <-- Process Hangs here
10.11.1.7
10.11.1.8
10.11.1.9
10.11.1.10
10.11.1.11
10.11.1.12

-----------------------

Code:
10.11.1.7 <--- start a new process from this point onwards.
10.11.1.8
10.11.1.9
10.11.1.10
10.11.1.11
10.11.1.12

How can this be achieved?

Last edited by jim mcnamara; 10-14-2017 at 08:52 AM..
 

10 More Discussions You Might Find Interesting

1. Solaris

script hangs-up at exit

I have a script that runs in verbose mode. At the end of the script it displays the final "exit" but then it hangs. What's going on?:( (5 Replies)
Discussion started by: davels
5 Replies

2. Linux

Script hangs on the unix server

We have a unix script scheduled to execute once in a day, some times it hangs on the server and never performs its operations, we need to manually kill the process and re-start that script, is there any way to have notification when the script hangs on the server. Thanks & Regards, Murthy. (3 Replies)
Discussion started by: Ramana Murthy
3 Replies

3. Shell Programming and Scripting

script calling other scripts hangs

I have a script that calls several other scripts in a specified order: # Loop over actions in specified order (STOP_ORDER or START_ORDER) and build and evaluate commands for command in $(eval print '$'${action}_ORDER) do printf "`date`\tExecuting ${action}_${command} = `eval print... (1 Reply)
Discussion started by: rein
1 Replies

4. Shell Programming and Scripting

script hangs when a remote server is down

Hi all, I have made a script which logins to remote servers and fetches some data from it. Is is working perfectly when all servers are reachable BUT my problem is -- if in case a server is down (or not reachable), the script hangs. Is there some way, that the script just continues to ssh... (6 Replies)
Discussion started by: vikas027
6 Replies

5. Shell Programming and Scripting

Hi Python and shell script,the script hangs

Hi I need to run a shell script from a TCL script,the shell script in trun will run a python script 1.Tcl script set filename "./GopiRun.sh" 2.GopiRun.sh python ./psi.py $MYSB/test_scripts/delivery/gpy1.py 3.I have my gpy1.py script. Here the problem i am facing is on running... (0 Replies)
Discussion started by: nathgopi214
0 Replies

6. UNIX for Dummies Questions & Answers

proceed through a menu-based program with a script?

I am trying to figure out a way to proceed through a menu-based program in UNIX with just one command to execute several steps. Is this possible? From the command prompt I would normally type the name of the program, 'disk_analysis' to start the program and bring up its menu. I would then... (4 Replies)
Discussion started by: nichola$
4 Replies

7. Solaris

script hangs when outputing to /dev/console

I am running solaris 8 on a sparcs box. The system is connected to a lightwave console server. I have a script that hangs when sending output to '/dev/console'. Any ideas? -V (2 Replies)
Discussion started by: vada010
2 Replies

8. Shell Programming and Scripting

Script Hangs!

Hi, I have script which is based on TCL and expect. It is written to test my code. It usually runs fine for a while and hangs after sometime. Code snippet set l_temp_timeout $timeout OUTPUT_LOG2 2 >>>$expect_out(buffer)<<< OUTPUT_LOG2 2... (2 Replies)
Discussion started by: naveenpn
2 Replies

9. Shell Programming and Scripting

script hangs when reading from stdin

script: while read inputline; do if ; then if ; then break fi fi done Looks like the script hangs when stdin is empty or contains space. Any ideas on how to circumvent this? is it possible to use getline to process stdin content? (4 Replies)
Discussion started by: ux4me
4 Replies

10. Shell Programming and Scripting

Expect script hangs Linux

When I run script listed below it causes my Linux to hang. When it freezes I can do totally nothing, move cursor, switch to another terminal or whatever. Linux is just not responding and the only way out I know is a hard reset of PC. #!/bin/bash if ; then echo "one parameter is needed: IP... (3 Replies)
Discussion started by: mass85
3 Replies
Geo::IPfree(3pm)					User Contributed Perl Documentation					  Geo::IPfree(3pm)

NAME
Geo::IPfree - Look up the country of an IPv4 address SYNOPSIS
use Geo::IPfree; my $geo = Geo::IPfree->new; my( $code1, $name1 ) = $geo->LookUp( '200.176.3.142' ); # use memory to speed things up $geo->Faster; # lookup by hostname my( $code2, $name2, $ip2 ) = $geo->LookUp( 'www.cnn.com' ); DESCRIPTION
Geo::IPfree is a Perl module that determines the originating country of an arbitrary IPv4 address. It uses a local file-based database to provide basic geolocation services. An updated version of the database can be obtained by visiting the Webnet77 website: http://software77.net/geo-ip/ <http://software77.net/geo-ip/>. METHODS
new( [$db] ) Creates a new Geo::IPfree instance. Optionally, a database filename may be passed in to load a custom data set rather than the version shipped with the module. LoadDB( $filename ) Load a specific database to use to look up the IP addresses. LookUp( $ip | $hostname ) Given an IP address or a hostname, this function returns three things: o The ISO 3166 country code (2 chars) o The country name o The IP address resolved NB: In order to use the location services on a hostname, you will need to have an internet connection to resolve a host to an IP address. If you pass a private IP address (for example 192.168.0.1), you'll get back a country code of ZZ, and country name of "Reserved for private IP addresses". Clean_Cache( ) Clears any cached lookup data. Faster( ) Make the LookUp() faster, which is good if you're going to be calling Lookup() many times. This will load the entire DB into memory and read from there, not from disk (good way for slow disk or network disks), but use more memory. The module "Memoize" will be enabled for some internal functions too. Note that if you call Lookup() many times, you'll end up using a lot of memory anyway, so you'll be better off using a lot of memory from the start by calling Faster(), and getting an improvement for all calls. nslookup( $host, [$last_lookup] ) Attempts to resolve a hostname to an IP address. If it fails on the first pass it will attempt to resolve the same hostname with 'www.' prepended. $last_lookup is used to supress this behavior. ip2nb( $ip ) Encodes $ip into a numerical representation. nb2ip( $number ) Decodes $number back to an IP address. dec2baseX( $number ) Converts a base 10 (decimal) number to base 86. baseX2dec( $number ) Converts a base 86 number to base 10 (decimal). VARS
$GeoIP->{db} The database file in use. $GeoIP->{handler} The database file handler. $GeoIP->{dbfile} The database file path. $GeoIP->{cache} BOOLEAN Set/tell if the cache of LookUp() is on. If it's on it will cache the last 1000 queries. Default: 1 The cache is good when you are parsing a list of IPs, generally a web log. If in the log you have many lines with the same IP, GEO::IPfree won't have to make a full search for each query, it will cache the last 1000 different IPs. After each 1000 IPs the cache is cleaned to restart it. Note that the Lookup make the query without the last IP number (xxx.xxx.xxx.0), then the cache for the IP 192.168.0.1 will be the same for 192.168.0.2 (they are the same query, 192.168.0.0). DB FORMAT
The data file has a list of IP ranges & countries, for example, from 200.128.0.0 to 200.103.255.255 the IPs are from BR. To make a fast access to the DB the format tries to use less bytes per input (block). The file was in ASCII and in blocks of 7 bytes: XXnnnnn XX -> the country code (BR,US...) nnnnn -> the IP range using a base of 85 digits (not in dec or hex to get space). See CPAN for updates of the DB... NOTES
The file ipscountry.dat is a dedicated format for Geo::IPfree. To convert it see the tool "ipct2txt.pl" in the "misc" directoy. The module looks for "ipscountry.dat" in the following locations: o /usr/local/share o /usr/local/share/GeoIPfree o through @INC (as well as all @INC directories plus "/Geo") o from the same location that IPfree.pm was loaded SEE ALSO
o http://software77.net/geo-ip/ AUTHOR
Graciliano M. P. <gm@virtuasites.com.br> MAINTAINER
Brian Cassidy <bricas@cpan.org> THANK YOU
Thanks to Laurent Destailleur (author of AWStats) that tested it on many OS and fixed bugs for them, like the not portable sysread, and asked for some speed improvement. COPYRIGHT &; LICENSE This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-14 Geo::IPfree(3pm)
All times are GMT -4. The time now is 02:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy