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.