Sponsored Content
Operating Systems OS X (Apple) Getting the External IP Address of your Computer and Storing it in a File Post 302214008 by Audacitor on Friday 11th of July 2008 05:15:49 PM
Old 07-11-2008
Getting the External IP Address of your Computer and Storing it in a File

My computer is one of three computer on our LAN. Our router is a Time Capsule. My computer is the only of of three computers that has been assigned a static IP address on the LAN, because it runs an Apache installation. I tinker around with web development from time to time, and I wanted to be able to demo my experiments to my friends without having to throw it on a flash drive.

My home computer doesn't have a domain name, of course. I access it with my IP address, which is dynamic, and changes whenever the cats dislodge the modem.

I'm trying to write a script that checks my external IP (there's only one, we don't have aliases or multiple routers or anything), and compares to the IP in a saved file. If it finds that the IP address it detected is different from the one in the file, it sends me an email and saves the new IP to the file, where it check it later on.

1. The script is called by launchd every 5 minutes.
2. The script checks my external IP.
3. It compares it to the IP in its save file.
4. If the IP is the same as the IP in the save file, the script quits.
5. If the IP is different, the script activates another program that sends me an email.
6. I recieve the email and can refer to IP address by looking at the message's header.

I'm new to UNIX, but not totally clueless. I can move around in my computer, move, copy, and delete files, ping servers, and other basic tasks. I usually learn a new command on my own, but in this case, ifconfig (which I think I need) is just way out of my league. Can anyone help?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Connecting an external SCSI drive to a unix computer

I am interested in booting up my unix computer by connecting an external SCSI drive( intergraph) to it. The unix box is also an intergraph computer. Whenever I boot it, it gives me an error that says Drive not ready, Insert Boot Diskette in A. What am I doing wrong? Any input would be... (3 Replies)
Discussion started by: teruotor
3 Replies

2. HP-UX

Connecting To An External Network Using A logical (PACKAGE) IP Address

Hie everyone, I am currently facing a problem whereby I can not connect to an external network from a package ip address on a HP-UX cluster. Below is the illustration: Primary Server IP Address : n.n.n.202 Secondary Server IP Address : n.n.n.212 Package IP Address : n.n.n.211 ... (1 Reply)
Discussion started by: cchilenga
1 Replies

3. IP Networking

Obtaining your external IP address using a Unix Utility

Hello, this is my first post on the Unix forums. This is something that's been bothering me for a while, is there any particular UNIX/Linux application that will allow you to see you external IP address? :confused: ( The address beyond your router ) Thank you in advance, I could not find a... (4 Replies)
Discussion started by: inquen
4 Replies

4. IP Networking

How to find the IP address of a computer that I am connected to?

Hi all, One of my computers (an iMac) was recently stolen, but I have been able to connect to it over the internet through Apple's 'back to my mac' feature. In order for the police to find these people they need to know the IP address of the stolen computer. I suspect that I will have find the... (6 Replies)
Discussion started by: RJFoulston
6 Replies

5. UNIX for Dummies Questions & Answers

How to set server's ip address, router, network mask and set if it is an internal or external ip?

Hello, I need to write a program which sets server's ip address, router, network mask. Program also should set if it is an internal or external ip. Maybe someone can help me ? Any information from u is very useful :b: I stopped at .. :( #!/bin/sh A=`hostname -i` echo "server ip address is $A"... (4 Replies)
Discussion started by: zagaruika
4 Replies

6. UNIX for Dummies Questions & Answers

Storing PDF File

Hi, We have generated Some BO reports and These BO reports Needs to be stored in PDF File format in unix server. Will Unix Support to store PDF Files ? Many Thanks Sashu (1 Reply)
Discussion started by: Sashanth_S
1 Replies

7. OS X (Apple)

mailx to external email address

Hi, How can I use "mailx" command to send message to an email address like this? echo "This email body" | mailx -s "my subject" "email@hostname.com" There may be some setup required in sendmail or postfix?? OS = Snow Leopard 10.6 (4 Replies)
Discussion started by: FlyingSquirrel
4 Replies

8. Shell Programming and Scripting

External IP Address of Linux Server

Hi, I am trying to find the external IP address of a server "XXX". I logged into server "XXX" and executed nslookup XXX. output number is 123.23.23.45 Later, i have executed "curl http://whatismyip.org". This time i got a different number 611.34.63.22 Out of these two numbers, what number... (1 Reply)
Discussion started by: forums123456
1 Replies

9. IP Networking

Ping domain indicates the external ip address and not the local ip

when i execute from local machine ping domainname i get the external ip address but i am on local dns and i expect the local ip address.. using nslookup : no problem so i cannot find why... thanks (2 Replies)
Discussion started by: activedms
2 Replies

10. UNIX for Beginners Questions & Answers

Finding specific string in file and storing in another file

Text in input file is like this <title> <band height="21" isSplitAllowed="true" > <staticText> <reportElement x="1" y="1" width="313" height="20" key="staticText-1"/> <box></box> <textElement> <font fontName="Arial" pdfFontName="Helvetica-Bold"... (4 Replies)
Discussion started by: aankita30
4 Replies
SLAPO-DYNGROUP(5)						File Formats Manual						 SLAPO-DYNGROUP(5)

NAME
slapo-dyngroup - Dynamic Group overlay to slapd SYNOPSIS
/etc/openldap/slapd.conf DESCRIPTION
The Dynamic Group overlay allows clients to use LDAP Compare operations to test the membership of a dynamic group the same way they would check against a static group. Compare operations targeting a group's static member attribute will be intercepted and tested against the configured dynamic group's URL attribute. Note that this intercept only happens if the actual Compare operation does not return a LDAP_COMPARE_TRUE result. So if a group has both static and dynamic members, the static member list will be checked first. CONFIGURATION
This slapd.conf option applies to the Dynamic Group overlay. It should appear after the overlay directive. attrpair <memberAttr> <URLattr> Specify the attributes to be compared. A compare operation on the memberAttr will cause the URLattr to be evaluated for the result. EXAMPLES
database bdb ... overlay dyngroup attrpair member memberURL FILES
/etc/openldap/slapd.conf default slapd configuration file SEE ALSO
slapd.conf(5), slapd-config(5). AUTHOR
Howard Chu OpenLDAP 2.4.21 2009/12/20 SLAPO-DYNGROUP(5)
All times are GMT -4. The time now is 08:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy