The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
MPAA Sets Up Fake Site to Catch Pirates - Slashdot iBot UNIX and Linux RSS News 0 07-07-2007 08:10 PM
system Fake IPs ppass SUN Solaris 2 04-26-2005 12:33 PM
Static wojtyla High Level Programming 6 02-25-2005 11:57 AM
Fake System32 Folder Kimm Linux 2 08-23-2004 10:25 AM
Static IP google IP Networking 7 05-18-2003 07:33 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-21-2007
heith's Avatar
heith heith is offline
Registered User
  
 

Join Date: Feb 2007
Location: Michigan, USA
Posts: 3
Exclamation Fake Static IP... (shell script)

I'm working on a script that runs on remote hosts and sends their dynamic IP address' to a server (which of course has statics).

All the client computers run linux (as does the server).

basically... the idea was:

1) Host a webpage on the server with a php script that displays only the IP address of the client.
I accomplished this with code: <?php echo $_SERVER['REMOTE_ADDR']; ?>

2) run a script (in a cron job) that queries the the server for its current IP, then checks it against the the last known IP. If its changed, it sends the updated IP address to the server. (the use the lynx domain.com/ip --dump command to get my public IP)


-- So... I have two questions. (maybe more)...


1) What do you guys think the best solution is to get the IP and hostname back to the server? I have shell access to all computers, so I thought scp at first... but a few of the computers have users I don't necessarily trust, so I really didn't want to use scp in a script...

2) I also would like to make a url forward to that computer... How can I for example:
"ssh user@domain.com/remote1" and have the php script (or any kind of script) redirect (...route) me to the remote hosts IP?

This is something I've been working on for a while... I realize it may not be the most elegant approach, but its what I came up with after much, much deliberation. So any Ideas... experinces... advise will be greatly appreciated!

Btw, This might be the first time I've ever posted an actual question about linux or anything for that matter. I can always find the answers I need by searching and reading... even if it takes weeks to figure out one little thing. So I wouldn't ask If I felt I could just google it and find the answers.

Last edited by heith; 02-22-2007 at 02:01 AM.. Reason: add icon so I would draw your attention :)
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0