[opensuse] dynamic ip - checking for new address and emailing it
I've mentioned this in threads once or twice before and I believe it was Per Jessen who proposed a wget one-liner, but after digging through the list archives and searching for an example, I'm not finding the exact thing I need. I need ssh access to a remote machine whose IP address is dynamic. Knowing nothing about scripting, I'd like to install a simple, minimal script on the remote machine that does the following: 1. checks on a regular basis, let's say every hour, for the current IP address 2. if the address has changed, and ONLY if it has changed, email me the new address I assume the address will need to be written to a file somewhere to be compared with on each check. Any suggestions? Cheers, gumb -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
gumb wrote:
I've mentioned this in threads once or twice before and I believe it was Per Jessen who proposed a wget one-liner, but after digging through the list archives and searching for an example, I'm not finding the exact thing I need.
I need ssh access to a remote machine whose IP address is dynamic.
Hi Gumb This sounds like you need an ssh tunnel, alternatively a vpn. I think that'll be much easier than what you have in mind. -- Per Jessen, Zürich (6.9°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
I need ssh access to a remote machine whose IP address is dynamic.
This sounds like you need an ssh tunnel, alternatively a vpn. I think that'll be much easier than what you have in mind.
It sounds to me that the best solution would be a dynamic DNS service. There are a number of them available. Personally, I use no-ip, and am very happy with them. -Nick -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Nick LeRoy wrote:
I need ssh access to a remote machine whose IP address is dynamic.
This sounds like you need an ssh tunnel, alternatively a vpn. I think that'll be much easier than what you have in mind.
It sounds to me that the best solution would be a dynamic DNS service. There are a number of them available. Personally, I use no-ip, and am very happy with them.
This is also a good idea, but when Gumb's only need is "ssh access to a remote machine', running an ssh tunnel on that remote mahcine is still easier. imho. -- Per Jessen, Zürich (9.1°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/10/2019 12:26 PM, Per Jessen wrote:
This is also a good idea, but when Gumb's only need is "ssh access to a remote machine', running an ssh tunnel on that remote mahcine is still easier. imho.
What address would that remote machine tunnel connect to, assuming the OP isn't using a static address? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
James Knott wrote:
On 02/10/2019 12:26 PM, Per Jessen wrote:
This is also a good idea, but when Gumb's only need is "ssh access to a remote machine', running an ssh tunnel on that remote mahcine is still easier. imho.
What address would that remote machine tunnel connect to, assuming the OP isn't using a static address?
I _was_ assuming the latter. If the local machine is dynamic, go with Nick's suggestion and set up dynamic DNS for that local machine. -- Per Jessen, Zürich (9.1°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 10/02/2019 18:32, Per Jessen wrote:
James Knott wrote:
On 02/10/2019 12:26 PM, Per Jessen wrote:
This is also a good idea, but when Gumb's only need is "ssh access to a remote machine', running an ssh tunnel on that remote mahcine is still easier. imho.
What address would that remote machine tunnel connect to, assuming the OP isn't using a static address?
I _was_ assuming the latter. If the local machine is dynamic, go with Nick's suggestion and set up dynamic DNS for that local machine.
Ah, the openSUSE lists. Either I get no response at all, or I go to do the washing up and come back to find a nine-post, three-way debate going on :-) It sounds like what I was hoping for isn't such a simple thing then to implement, after all. I do have a static IP here at home, however, there's two caveats: - I might on the odd occasion need ssh access on my local laptop from a location other than home - Despite having a static IP at home, this opens up another can of worms. There's another user, I believe it may be jdd, who has the same French ISP as me, 'Free'. I've tried to ssh back home from the remote machine in the past and had no luck, even though the settings are identical. This is something to do with the messed up setup of Free and reverse DNS and whatnot. I'm not expert enough on any such topics to know the right terminology, but having perused the Free newsgroups for several months I know it's a nightmare that many users run into. In spite of the static IP, IPv4 address ranges with Free are somehow allocated in such a way that many - if not most - customers do not get full reverse functionality back to their IP. Reading the continual complaints from users about this only leaves me confused as to the exact implications. There may be a straightforward workaround but with other implications and configurations that I'd need to consider. Going gung-ho IPv6 would probably cure these ills but that's another whole area I don't know enough about to deal with at present. I'd hoped a combination of wget, cron and email would be an easier short-term fix. gumb -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
gumb wrote:
On 10/02/2019 18:32, Per Jessen wrote:
James Knott wrote:
On 02/10/2019 12:26 PM, Per Jessen wrote:
This is also a good idea, but when Gumb's only need is "ssh access to a remote machine', running an ssh tunnel on that remote mahcine is still easier. imho.
What address would that remote machine tunnel connect to, assuming the OP isn't using a static address?
I _was_ assuming the latter. If the local machine is dynamic, go with Nick's suggestion and set up dynamic DNS for that local machine.
Ah, the openSUSE lists. Either I get no response at all, or I go to do the washing up and come back to find a nine-post, three-way debate going on :-)
Much depends on the information provided :-)
It sounds like what I was hoping for isn't such a simple thing then to implement, after all. I do have a static IP here at home,
Permit me to chop the text right there - with that information, I still say "ssh tunnel".
however, there's two caveats:
- I might on the odd occasion need ssh access on my local laptop from a location other than home
So far you would still be okay. You ssh to your home machine, then to your remote machine.
- Despite having a static IP at home, this opens up another can of worms. There's another user, I believe it may be jdd, who has the same French ISP as me, 'Free'. I've tried to ssh back home from the remote machine in the past and had no luck, even though the settings are identical. This is something to do with the messed up setup of Free and reverse DNS and whatnot.
Ignoring DNS, if you know the IP address, ssh is possible - provided no firewall or NAT gets in the way.
I'm not expert enough on any such topics to know the right terminology, but having perused the Free newsgroups for several months I know it's a nightmare that many users run into.
If I were to give you the IP address and user credentials of one of my machine, I would be very surprised if you cannot access it by ssh.
In spite of the static IP, IPv4 address ranges with Free are somehow allocated in such a way that many - if not most - customers do not get full reverse functionality back to their IP.
Yes, this is not all that unusual. For most things, you don't need reverse mapping, it is mostly needed/useful when you want to run a mailserver.
Reading the continual complaints from users about this only leaves me confused as to the exact implications.
Me too. Sofar you have described a lot of hear-say, but we haven't heard if you have any actual problem. If you want to be notified when a machine changes its IP address, put a script in /etc/sysconfig/network/if-up.d/. script: $!/bin/sh (echo "new address:" ip addr ) | mail -s "new address" zinc.anode@jessen.ch -- Per Jessen, Zürich (8.5°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/10/2019 12:09 PM, Per Jessen wrote:
gumb wrote:
I've mentioned this in threads once or twice before and I believe it was Per Jessen who proposed a wget one-liner, but after digging through the list archives and searching for an example, I'm not finding the exact thing I need.
I need ssh access to a remote machine whose IP address is dynamic. Hi Gumb
This sounds like you need an ssh tunnel, alternatively a vpn. I think that'll be much easier than what you have in mind.
Unless that tunnel or VPN originate from the remote site, it won't do him much good. Of course, that solution might then have the same problem in reverse, that is finding a dynamic address. People often rely on dynamic DNS for this sort of thing, but there is another possibility. The dynamic address might have a host name that doesn't change. For example, with my ISP, my host name is a fairly long one that's based on the firewall & modem MAC addresses. As long as the hardware doesn't change, the host name doesn't either. In this situation, just use the host name, rather than IP address. My host name looks like this: CPE[firewall MAC]-CM[modem MAC].cpe.net.cable.rogers.com I don't know about now, but there used to be a hook in the DHCP client script that could be used to run another script, such as the one the OP wants to use to send email. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
James Knott wrote:
On 02/10/2019 12:09 PM, Per Jessen wrote:
gumb wrote:
I've mentioned this in threads once or twice before and I believe it was Per Jessen who proposed a wget one-liner, but after digging through the list archives and searching for an example, I'm not finding the exact thing I need.
I need ssh access to a remote machine whose IP address is dynamic. Hi Gumb
This sounds like you need an ssh tunnel, alternatively a vpn. I think that'll be much easier than what you have in mind.
Unless that tunnel or VPN originate from the remote site, it won't do him much good.
James, it would obviously originate on the remote. Unless you can establish a tunnel to a machine you don't know the address of :-) -- Per Jessen, Zürich (8.1°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/10/2019 12:38 PM, Per Jessen wrote:
Unless that tunnel or VPN originate from the remote site, it won't do him much good. James, it would obviously originate on the remote. Unless you can establish a tunnel to a machine you don't know the address of :-)
That was my point, no matter which end originates the tunnel, it has to know the address of the other end. This means either dynamic DNS or static host name, as I have here. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Sun, 10 Feb 2019, gumb wrote:
1. checks on a regular basis, let's say every hour, for the current IP address 2. if the address has changed, and ONLY if it has changed, email me the new address
==== #!/bin/bash IPFILE=/var/state/my_ext_ip HOST="foo" getip() { curl -q http://checkip.dyndns.org | \ sed 's/.*: *\([0-9.]*\)[ <].*/\1/' } lastip=$(< "$IPFILE" ) curip=$(getip) if test "x$curip" != "x$lastip"; then echo "$curip" | mail -s "New IP for $HOST" you@example.com || exit 1 # update IPFILE if mail successfully spooled echo "$curip" >"$IPFILE" fi ==== Adjust IPFILE / HOST as you need and run the script every so often via cron / systemd-timer or whatever... HTH, -dnh -- Shouldn't a "programmer's editor" be called a "bugger"? -- Graham Reed -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/02/2019 06:55, David Haller wrote:
==== #!/bin/bash IPFILE=/var/state/my_ext_ip HOST="foo"
getip() { curl -q http://checkip.dyndns.org | \ sed 's/.*: *\([0-9.]*\)[ <].*/\1/' }
lastip=$(< "$IPFILE" ) curip=$(getip) if test "x$curip" != "x$lastip"; then echo "$curip" | mail -s "New IP for $HOST" you@example.com || exit 1 # update IPFILE if mail successfully spooled echo "$curip" >"$IPFILE" fi ====
Adjust IPFILE / HOST as you need and run the script every so often via cron / systemd-timer or whatever...
Thanks. Forgive my ignorance, but by HOST do you mean just the hostname of the machine? And what would be the necessity of changing IPFILE? Aside from adjusting the name of the file 'my_ext_ip' if desired, is that the only significance? I was going to ask about cron / systemd. Is the former deprecated? Or at least, is systemd now the preferred option? gumb -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/02/2019 09.04, gumb wrote:
I was going to ask about cron / systemd. Is the former deprecated? Or at least, is systemd now the preferred option?
What matters here is your own preference. I use cron, I see no reason to change. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)
gumb wrote:
On 11/02/2019 06:55, David Haller wrote:
==== #!/bin/bash IPFILE=/var/state/my_ext_ip HOST="foo"
getip() { curl -q http://checkip.dyndns.org | \ sed 's/.*: *\([0-9.]*\)[ <].*/\1/' }
lastip=$(< "$IPFILE" ) curip=$(getip) if test "x$curip" != "x$lastip"; then echo "$curip" | mail -s "New IP for $HOST" you@example.com || exit 1 # update IPFILE if mail successfully spooled echo "$curip" >"$IPFILE" fi ====
Adjust IPFILE / HOST as you need and run the script every so often via cron / systemd-timer or whatever...
Thanks.
Forgive my ignorance, but by HOST do you mean just the hostname of the machine?
Yes, try "echo $HOST" from the shell.
And what would be the necessity of changing IPFILE?
To record the current ip, thereby enabling checking if it has changed.
I was going to ask about cron / systemd. Is the former deprecated?
No, not yet.
Or at least, is systemd now the preferred option?
It's probably safe to say openSUSE is moving towards systemd timers, but for the time being, I personally find it easier to open a crontab and type in the one-liner. -- Per Jessen, Zürich (3.0°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/02/2019 10:15, Per Jessen wrote:
gumb wrote:
On 11/02/2019 06:55, David Haller wrote:
==== #!/bin/bash IPFILE=/var/state/my_ext_ip HOST="foo"
getip() { curl -q http://checkip.dyndns.org | \ sed 's/.*: *\([0-9.]*\)[ <].*/\1/' }
lastip=$(< "$IPFILE" ) curip=$(getip) if test "x$curip" != "x$lastip"; then echo "$curip" | mail -s "New IP for $HOST" you@example.com || exit 1 # update IPFILE if mail successfully spooled echo "$curip" >"$IPFILE" fi ====
Adjust IPFILE / HOST as you need and run the script every so often via cron / systemd-timer or whatever...
Thanks.
Forgive my ignorance, but by HOST do you mean just the hostname of the machine?
Yes, try "echo $HOST" from the shell.
And what would be the necessity of changing IPFILE?
To record the current ip, thereby enabling checking if it has changed.
I understood the theory, but wasn't sure if the actual string IPFILE has any significance or is just a random name. I've now installed the script. But I've never set up any mail service as root on the remote machine. What do I do to ensure it mails me, do I have to set up an account in a mailing app? gumb -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2019-02-11 at 11:16 +0100, gumb wrote:
if test "x$curip" != "x$lastip"; then echo "$curip" | mail -s "New IP for $HOST" you@example.com || exit 1
I understood the theory, but wasn't sure if the actual string IPFILE has any significance or is just a random name.
I've now installed the script. But I've never set up any mail service as root on the remote machine. What do I do to ensure it mails me, do I have to set up an account in a mailing app?
You have to configure "mail" as you would configure Thunderbird to send mail. Read the man page... No need to setup a mail service, but of course you can - I do, I find it more reliable. - -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHkEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXGFNghwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVTQkAlRTJOG+cVRx/aWYpNjIG mMPtvhMAniAWZnZPnMEEUo2BWtndal+AI680 =Hqaa -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/02/2019 11:25, Carlos E. R. wrote:
On Monday, 2019-02-11 at 11:16 +0100, gumb wrote:
I understood the theory, but wasn't sure if the actual string IPFILE has any significance or is just a random name.
I've now installed the script. But I've never set up any mail service as root on the remote machine. What do I do to ensure it mails me, do I have to set up an account in a mailing app?
You have to configure "mail" as you would configure Thunderbird to send mail. Read the man page...
No need to setup a mail service, but of course you can - I do, I find it more reliable.
Ah ok. I've heard of things like pine, alpine, mutt, etc., though never used them. I didn't know there was just a generic thing called 'mail'. I'll look into it. gumb -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2019-02-11 at 11:30 +0100, gumb wrote:
On 11/02/2019 11:25, Carlos E. R. wrote:
On Monday, 2019-02-11 at 11:16 +0100, gumb wrote:
I understood the theory, but wasn't sure if the actual string IPFILE has any significance or is just a random name.
I've now installed the script. But I've never set up any mail service as root on the remote machine. What do I do to ensure it mails me, do I have to set up an account in a mailing app?
You have to configure "mail" as you would configure Thunderbird to send mail. Read the man page...
No need to setup a mail service, but of course you can - I do, I find it more reliable.
Ah ok. I've heard of things like pine, alpine, mutt, etc., though never used them. I didn't know there was just a generic thing called 'mail'. I'll look into it.
"mail" is even older and much simpler than those. It is command line. No menus. But openSUSE fortunately uses "mailx" instead of the plain unix "mail", or you would be stuck with configuring postfix. - -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXGFPvRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVjLgAoIPuYgESiz4QCUbjUqQ0 27qF5R0QAJ9wohVJxwUnAb7uwkVm+icqRffZrg== =4diL -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos E. R. wrote:
On Monday, 2019-02-11 at 11:16 +0100, gumb wrote:
if test "x$curip" != "x$lastip"; then echo "$curip" | mail -s "New IP for $HOST" you@example.com || exit 1
I understood the theory, but wasn't sure if the actual string IPFILE has any significance or is just a random name.
I've now installed the script. But I've never set up any mail service as root on the remote machine. What do I do to ensure it mails me, do I have to set up an account in a mailing app?
You have to configure "mail" as you would configure Thunderbird to send mail. Read the man page...
Interesting, I was not aware mailx could do all that. It's a very long man page.
No need to setup a mail service, but of course you can - I do, I find it more reliable.
It's easier than writing that .mailrc config I think :-) (zypper in postfix, and it's done). -- Per Jessen, Zürich (5.1°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2019-02-11 at 11:53 +0100, Per Jessen wrote:
Carlos E. R. wrote:
On Monday, 2019-02-11 at 11:16 +0100, gumb wrote:
You have to configure "mail" as you would configure Thunderbird to send mail. Read the man page...
Interesting, I was not aware mailx could do all that. It's a very long man page.
No need to setup a mail service, but of course you can - I do, I find it more reliable.
It's easier than writing that .mailrc config I think :-) (zypper in postfix, and it's done).
Depends - not in Spain with dynamic IP. Directly it doesn't work, because every mail server out there blocks me as spammer, for being on dynamic IP, no valid reverse DNS, etc. The lot. Score 20 if not direct denial. So the usual step would be setting up the smarthost setting in YaST. Well, not in Spain, because it is impossible to send an email from name@gmx.es when using telefonica.net as smarthost, or any other combination. All mail providers I have tried *demand* that the from: address matches the smarthost. So you have to configure postfix to use several different relay-hosts, one per account. Not one per ISP, but one per account. You have a dozen mail addresses, then a dozen matching entries in two or three files in postfix, plus certain configuration changes in main.cf If you think this is only Spain, then no, hardly: because postfix added the configuration support to cover this precise situation just in time, and I didn't write to postfix asking for it. Set: sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relayhost Doc: cer@Telcontar:~> grep sender_dependent_relayhost_maps /usr/share/doc/packages/postfix-doc/README_FILES/* /usr/share/doc/packages/postfix-doc/README_FILES/ADDRESS_VERIFICATION_README:address_verify_sender_dependent_relayhost_maps parameter does the same for /usr/share/doc/packages/postfix-doc/README_FILES/SASL_README: sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay /usr/share/doc/packages/postfix-doc/README_FILES/SOHO_README: sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay cer@Telcontar:~> - -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXGFc2Bwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVWqYAnj7uJZr5C2xcYRoHzVhj 9mzaV0miAJ9Y2sWwUdqX8heERi0jRRXHdLHEgg== =T7y6 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
gumb wrote:
And what would be the necessity of changing IPFILE?
To record the current ip, thereby enabling checking if it has changed.
I understood the theory, but wasn't sure if the actual string IPFILE has any significance or is just a random name.
Sorry, I misunderstood. IPFILE is just a variable name set in the beginning of the script. The filename has no particular significance, it just needs to be stored somewhere the script will have access to.
I've now installed the script. But I've never set up any mail service as root on the remote machine. What do I do to ensure it mails me, do I have to set up an account in a mailing app?
"mail" will just drop the mail in the normal queue, so you will need e.g. postfix/sendmail/exim running on the remote machine. I think the openSUSE standard postfix config will suffice. -- Per Jessen, Zürich (4.0°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2019-02-11 at 11:34 +0100, Per Jessen wrote:
I've now installed the script. But I've never set up any mail service as root on the remote machine. What do I do to ensure it mails me, do I have to set up an account in a mailing app?
"mail" will just drop the mail in the normal queue, so you will need e.g. postfix/sendmail/exim running on the remote machine. I think the openSUSE standard postfix config will suffice.
No, that was the old "mail". The current "mail" is actually "mailx", and can work without postfix. But the line in the script will not suffice. - -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHIEARECADIWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXGFQUhQccm9iaW4ubGlz dGFzQGdteC5lcwAKCRC1MxgcbY1H1QNDAKCLMw/gxkrbfss+fs/StOwhJiY7UwCf WyhAV9YSCSOAhlxTZDrPokFIab0= =uHZ7 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 10/02/2019 17.43, gumb wrote:
I've mentioned this in threads once or twice before and I believe it was Per Jessen who proposed a wget one-liner, but after digging through the list archives and searching for an example, I'm not finding the exact thing I need.
I need ssh access to a remote machine whose IP address is dynamic. Knowing nothing about scripting, I'd like to install a simple, minimal script on the remote machine that does the following:
1. checks on a regular basis, let's say every hour, for the current IP address 2. if the address has changed, and ONLY if it has changed, email me the new address
I assume the address will need to be written to a file somewhere to be compared with on each check.
Any suggestions?
I have such a script, yes. But mine gets the address by asking my current router. Not every hour, but every five minutes. If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router. The script tells the DNS server about the change. As a backup, I also email myself of the change. As I ask my router, unless you have the same model, my script would have to be adapted for you. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)
Carlos E. R. wrote:
On 10/02/2019 17.43, gumb wrote:
I've mentioned this in threads once or twice before and I believe it was Per Jessen who proposed a wget one-liner, but after digging through the list archives and searching for an example, I'm not finding the exact thing I need.
I need ssh access to a remote machine whose IP address is dynamic. Knowing nothing about scripting, I'd like to install a simple, minimal script on the remote machine that does the following:
1. checks on a regular basis, let's say every hour, for the current IP address 2. if the address has changed, and ONLY if it has changed, email me the new address
I assume the address will need to be written to a file somewhere to be compared with on each check.
Any suggestions?
I have such a script, yes. But mine gets the address by asking my current router. Not every hour, but every five minutes.
If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router.
Many routers have a generic setup for dynamic DNS. No local scripting needed. If you have to run wget/curl from cron, you usually don't need to know your own address. -- Per Jessen, Zürich (2.9°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/02/2019 10.23, Per Jessen wrote:
Carlos E. R. wrote:
On 10/02/2019 17.43, gumb wrote:
Any suggestions?
I have such a script, yes. But mine gets the address by asking my current router. Not every hour, but every five minutes.
If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router.
Many routers have a generic setup for dynamic DNS. No local scripting needed. If you have to run wget/curl from cron, you usually don't need to know your own address.
Not exactly. My router only handles DynDNS.org, TZO, and No-IP (my previous router handled even less). They are specific organizations. No other services are allowed. I can not drop my own script on the router to handle another service, none of the routers I have used could. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)
Carlos E. R. wrote:
On 11/02/2019 10.23, Per Jessen wrote:
Carlos E. R. wrote:
On 10/02/2019 17.43, gumb wrote:
Any suggestions?
I have such a script, yes. But mine gets the address by asking my current router. Not every hour, but every five minutes.
If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router.
Many routers have a generic setup for dynamic DNS. No local scripting needed. If you have to run wget/curl from cron, you usually don't need to know your own address.
Not exactly. My router only handles DynDNS.org, TZO, and No-IP (my previous router handled even less). They are specific organizations. No other services are allowed.
Well, I did say "many routers", "not every". -- Per Jessen, Zürich (3.4°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/02/2019 11.09, Per Jessen wrote:
Carlos E. R. wrote:
On 11/02/2019 10.23, Per Jessen wrote:
Carlos E. R. wrote:
On 10/02/2019 17.43, gumb wrote:
Any suggestions?
I have such a script, yes. But mine gets the address by asking my current router. Not every hour, but every five minutes.
If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router.
Many routers have a generic setup for dynamic DNS. No local scripting needed. If you have to run wget/curl from cron, you usually don't need to know your own address.
Not exactly. My router only handles DynDNS.org, TZO, and No-IP (my previous router handled even less). They are specific organizations. No other services are allowed.
Well, I did say "many routers", "not every".
Well, I have not seen a single router that has that generic capability. Some provided by the ISP, some I bought, some I used in training. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)
On 11/02/2019 11:13, Carlos E. R. wrote:
If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router.
As far as I know, no such thing is set up. gumb -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2019-02-11 at 11:17 +0100, gumb wrote:
On 11/02/2019 11:13, Carlos E. R. wrote:
If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router.
As far as I know, no such thing is set up.
If your router allows it, it is the easiest posibility of all. - -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXGFN0hwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVTiUAn0UFECb2wlcEmyPv03PG p27VURDXAJ9FjvHaro/ssmpDq+7FdVbls/w4Rw== =wf7X -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Monday, 11 February 2019 20:43:09 ACDT Carlos E. R. wrote:
On 11/02/2019 11.09, Per Jessen wrote:
Carlos E. R. wrote:
On 11/02/2019 10.23, Per Jessen wrote:
Carlos E. R. wrote:
On 10/02/2019 17.43, gumb wrote:
Any suggestions?
I have such a script, yes. But mine gets the address by asking my current router. Not every hour, but every five minutes.
If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router.
Many routers have a generic setup for dynamic DNS. No local scripting needed. If you have to run wget/curl from cron, you usually don't need to know your own address.
Not exactly. My router only handles DynDNS.org, TZO, and No-IP (my previous router handled even less). They are specific organizations. No other services are allowed.
Well, I did say "many routers", "not every".
Well, I have not seen a single router that has that generic capability. Some provided by the ISP, some I bought, some I used in training.
You clearly have never used a Cisco router, then... ;) -- ============================================================== Rodney Baker VK5ZTV rodney.baker@iinet.net.au CCNA #CSCO12880208 ==============================================================
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2019-02-13 at 22:45 +1030, Rodney Baker wrote:
On Monday, 11 February 2019 20:43:09 ACDT Carlos E. R. wrote:
On 11/02/2019 11.09, Per Jessen wrote:
Carlos E. R. wrote:
Not exactly. My router only handles DynDNS.org, TZO, and No-IP (my previous router handled even less). They are specific organizations. No other services are allowed.
Well, I did say "many routers", "not every".
Well, I have not seen a single router that has that generic capability. Some provided by the ISP, some I bought, some I used in training.
You clearly have never used a Cisco router, then... ;)
I touched a large one in training, but I have never been able to spend time with one. Normally I only see home routers - even on businesses. - -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXGQf5Bwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVP34AnRgLrVVEcQTApwxOKzlm KfHSLVQnAJ0R5HZD/y2GlKNAqRncQgmkJuRiMQ== =rj5p -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Carlos E. R. <robin.listas@telefonica.net> [02-13-19 08:49]:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wednesday, 2019-02-13 at 22:45 +1030, Rodney Baker wrote:
On Monday, 11 February 2019 20:43:09 ACDT Carlos E. R. wrote:
On 11/02/2019 11.09, Per Jessen wrote:
Carlos E. R. wrote:
Not exactly. My router only handles DynDNS.org, TZO, and No-IP (my previous router handled even less). They are specific organizations. No other services are allowed.
Well, I did say "many routers", "not every".
Well, I have not seen a single router that has that generic capability. Some provided by the ISP, some I bought, some I used in training.
You clearly have never used a Cisco router, then... ;)
I touched a large one in training, but I have never been able to spend time with one. Normally I only see home routers - even on businesses.
- -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar)
-----BEGIN PGP SIGNATURE-----
iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXGQf5Bwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVP34AnRgLrVVEcQTApwxOKzlm KfHSLVQnAJ0R5HZD/y2GlKNAqRncQgmkJuRiMQ== =rj5p -----END PGP SIGNATURE-----
cisco also makes home routers, I believe under linksys name, since 2003. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Registered Linux User #207535 @ http://linuxcounter.net Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@telefonica.net> [02-13-19 08:49]:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wednesday, 2019-02-13 at 22:45 +1030, Rodney Baker wrote:
On Monday, 11 February 2019 20:43:09 ACDT Carlos E. R. wrote:
On 11/02/2019 11.09, Per Jessen wrote:
Carlos E. R. wrote:
Not exactly. My router only handles DynDNS.org, TZO, and No-IP (my previous router handled even less). They are specific organizations. No other services are allowed.
Well, I did say "many routers", "not every".
Well, I have not seen a single router that has that generic capability. Some provided by the ISP, some I bought, some I used in training.
You clearly have never used a Cisco router, then... ;)
I touched a large one in training, but I have never been able to spend time with one. Normally I only see home routers - even on businesses.
[snip]
cisco also makes home routers, I believe under linksys name, since 2003.
Cisco also used to (maybe they still do?) produce a range of small(ish) ISDN routers, typical for SOHO or small business. 800 series? -- Per Jessen, Zürich (6.1°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/13/2019 08:52 AM, Patrick Shanahan wrote:
cisco also makes home routers, I believe under linksys name, since 2003.
Does Cisco still own Linksys? I thought they sold them after a few years. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* James Knott <james.knott@jknott.net> [02-13-19 09:10]:
On 02/13/2019 08:52 AM, Patrick Shanahan wrote:
cisco also makes home routers, I believe under linksys name, since 2003.
Does Cisco still own Linksys? I thought they sold them after a few years.
sold to Belkin in 2013 which maintained the brand name Linksys and provides support. but: All routers have one thing in common, they are built by Sercomm, this is a company that handles the manufacturing for a number of brands including Linksys, Netgear, 3Com, Aruba and Belkin. (per wikipedia). -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Registered Linux User #207535 @ http://linuxcounter.net Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (9)
-
Carlos E. R.
-
Carlos E. R.
-
David Haller
-
gumb
-
James Knott
-
Nick LeRoy
-
Patrick Shanahan
-
Per Jessen
-
Rodney Baker