Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: dmclean on May 13, 2003, 09:19:56 PM
-
Because my ISP provides me with a dynamic IP address, I can never use FTP or VPN to connect to my Mitel server at home unless I write it down in the morning before I go to work. I was wondering if anyone knew how I could get the Mitel server to automatically update a page on my personal webspace, which I know the address of, with its IP address on a regular basis. If that were possible I could use my browser to look on my webspace to get my IP adresss, which in turn I could use to connect to my home server using VPN or FTP. Or is there any easier way?
Please remove HATESPAM to email.
Thanks,
dmclean
-
You're looking for a dynamic DNS service. One free one supported by SME is dyndns.org.
-
Or save the script below as mail-external-ip, put it in /etc/e-smith/events/actions/, and do:
# cd /etc/e-smith/events/ip-change/
# ln -s ../actions/mail-external-ip S95mail-external-ip
This will send an email with the new ip to the specified email addresses each time the ip changes. Be sure to save the script as a Unix text file to avoid problems with CR/LF.
#!/bin/sh
recipients="address1@domain1.tld address2@domain2.tld"
mail -s "hostname -f now at $2" $recipients <As of date the external IP of hostname -f is $2.
EOF
-
Thank you Robert for the script, it looks like what I need. However, I'm a bit of a Newbee at using the SME server software and linux. Would you be able to walk me through your instructions with a little more detail? I have installed some RPMs, but other than that I could use some help.
Greatly appreciated,
D'Arcy
Please remove NOSPAM to email.
-
For some reason this, and other scripts involving 'mail' from the shell, do not work in SME5.6. any ideas?
there are no error messages , it seems that the mail.rc file may be wrong or something similar.
>
> #!/bin/sh
>
> recipients="address1@domain1.tld address2@domain2.tld"
> mail -s "hostname -f now at $2" $recipients <> As of date the external IP of hostname -f is $2.
> EOF
-
Use dyndns.org, it doesn't get any easier
go to dyndns.org (that's dyndns.ORG)
join and choose your subdomain name password etc
login to your sme server as admin (or use the server console)
select 'configure server' and turn on dyndns service and enter your dyndns username and password
reboot(?)
you can now login to your server using your chosen subdomain.domain
-
D'Arcy, before walking you through the mail script, we need to determine if the "mail" command actually works on SME 5.6. I use SME 5.5 and was unaware of any problems with the mail command on 5.6, but Mike says it doesn't work. Here are some tests:
1. Log in as a regular user. There are many resources that explain how to enable this; one of them is my SME/Alpha FAQ at http://www.robert2.dds.nl/faq.html
2. Try to send a message to yourself with the mail command (example is for local user "robert")
$ echo "This is test one" |mail -s test1 robert
Now, because Mike suggested there might be a problem with /etc/mail.rc, do this as well:
$ echo "This is test two" |mail -n -s test2 robert
Now read your local mail locally with the pine mail and news reader:
$ pine -i
Please report back if either of these test messages reached you.
-
Hi Gaz,
I followed your advice, got a free account at dyndns.org etc.
If I enter www.username.dnsalias.xxx in my web browser it comes up with the default web page OK, but how do I access server-manager and my personal files?Please forgive me but I am still fairly new at this.
Thanks in advance,
Del
-
Gaz,
I did this it worked pretty well. However, my IP address changed today but dyndns didn't pick up the change. I was under the impression that the sme server sent a message automatically to dyndns for me. Am I wrong in this assumption? And if so, what can I do to get my IPs changed automatically?
D'Arcy
-
I had the same problem but fixed it when I edited the script that tells the dyndns.org server the right name for my home address.
Instructions are on this forums somewhere.
HOWEVER:
The easy way to fix this is to go back into your server config, and rename your home network the same name as your .dyndns.org account.
eg
If your home network is called "home.net" and your dyndns.org account is "buttmonkey.dyndns.org", then go into your server and rename home.net to buttmonkey.dyndns.org.
Then the script will tell dyndns.org that the buttmonkey address needs updating.
Then you can put home.net as another domain and it all works again.
-
Hi Del,
Sorry, I've been out of the loop for a while.
> OK, but how do I access
> server-manager and my personal files?
The first thing here is are you trying to access the server-manager and personal files from the "outside" ie. from the Internet?
Gaz
-
Andy,
Thanks for pointing out my mandatory error. :)
If I remember correctly (it's been a long time) it is crucial to change the 'Primary Domain Name' of the SME box to exactly the same as your dnydns.org domain.
To do that, you go to the Server Console and then select Configure this server. Then, after you say yes it is the first parameter you can change.
Gaz
-
DOes this schript also work without DYNDNS services.
I also have an dynamic ip and my hosting company is forwading everything to this ip adress. So when my ip changes i want to be notifed by mail, or sent i directly to them.
i've tried the script, but when i test it from the command line, i receive a mail but without the ip-adress.
i can not tried it by changing the IP. so for this i've to wait.
-
the script is working.
after a reboot i've recieved a message from anonymous@pdebrabander.nl.
-
There's a syntax error in that mail-external-ip script. It should of course read:
#!/bin/sh
recipients="address1@domain1.tld address2@domain2.tld"
mail -s "hostname -f now at $2" $recipients <<EOF
As of date the external IP of hostname -f is $2.
EOF
-
D'Arcy
> However, my IP address changed today but dyndns
> didn't pick up the change.
As well as setting up a dyndns.org account, did you also actually log on to your sme server as admin and run Configure this server, and enter the details for you dyndns account, username password etc.
The server needs these so it can automatically talk to dyndns.org for you every time the IP changes.
Once you set it ALL up correctly it works very well.
Edit:
Oh, just spotted that the original post is from 2003, bit late with a reply, oh well.
-
Hi Ray
I belive that you only need the IP number if it changes right ?????
If it is the case get a yahoo hotmail ore what ever email acount and goo with the MC midnight comander to the folder etc/ppp/ip-up edit it at the end before the last line
echo $4 | mail -s "My New IP " yourname@yahoo.com
exit 0
Youn can send severals acounts even to your celular ..
I hope that it help you
Best regards
Al
LU2FGN :hammer: