Problem running a script after no-ip update Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
darren
Posts: 4
Joined: Sat Oct 17, 2020 1:39 am

Problem running a script after no-ip update

Post by darren »

I have used no-ip to update dynamic DNS for some time and it work great. I recently tried to have it run a script after update, but it didn't run. The script runs fine when manually triggered, but the no-ip program does not trigger it.
If I run:

Code: Select all

noip2 -S
I get the following output (with redacted ####)

Code: Select all

1 noip2 process active.

Process 11584, started as noip2, (version 2.1.9)
Using configuration from /usr/local/etc/no-ip2.conf
Last IP Address set ###.###.###.###
Account ################@gmail.com
configured for:
        host  #################.noip.me
Executing /tmp/DietPi-Config/bash  upon successful update.
Updating every 30 minutes via /dev/eth0 with NAT enabled.
The problem is that second last line (Executing). That is not the path I entered for the script and it doesn't even exist. I carefully entered /mnt/dietpi_userdata/wan-ip-update.sh. And yes, that is the path to the script, and as I mentioned, it runs fine manually. It seems that the path to the script is not being properly captured or saved by the no-ip config program. There is nothing intelligible in the no-ip2.conf file (seems encrypted).

Any advice?
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: Problem running a script after no-ip update

Post by Joulinar »

Hi,

many thanks for your message. Well /tmp/DietPi-Config/bash is a temporary directory and might be present during execution only I guess. How did you entered your script to No-IP?? You could try to include your script into noip2.service using ExecStartPost= command.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
darren
Posts: 4
Joined: Sat Oct 17, 2020 1:39 am

Re: Problem running a script after no-ip update

Post by darren »

I ran the dietpi-config utility, and under "network options misc" there is a no-ip utility. After it walks you through the no-ip setup it asks you if you would like to run a script on success. That is where I enter the path.

Code: Select all

Auto configuration for Linux client of no-ip.com.

Multiple network devices have been detected.

Please select the Internet interface from this list.

By typing the number associated with it.
0       eth0
1       tun0
0
Please enter the login/email string for no-ip.com ########@gmail.com
Please enter the password for user '########@gmail.com'  ************

3 hosts are registered to this account.
Do you wish to have them all updated?[N] (y/N)  y
Please enter an update interval:[30]  30
Do you wish to run something at successful update?[N] (y/N)  y
Please enter the script/program name  /mnt/dietpi_userdata/wan-ip-update.sh

New configuration file '/usr/local/etc/no-ip2.conf' created.

Press any key to continue...
edit: after running the utility again, it appears that the path is accepted. Not sure how that happened. I tried it so many times before and it wouldn't stick. Now it does. I guess I screwed something up before. However, the script is still not being run upon successful no-ip update. Could it be a permissions problem?
darren
Posts: 4
Joined: Sat Oct 17, 2020 1:39 am

Re: Problem running a script after no-ip update

Post by darren »

I found an article here that makes me think I misunderstood what to expect from an "update":
https://www.noip.com/support/knowledgeb ... p-address/
It is confusingly worded, but it says "Updates are only done when your IP address changes" and "Your IP address must change for an update to be logged".
So maybe I mistakenly thought the update script would be triggered every update interval (30 minutes in my case). Apparently, that is not what it means. It seems instead that the script is only supposed to run when the actual IP address changes. It's a bit hard to confirm because it might be a few weeks before it changes on me. Can anyone confirm the expected behavior?
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: Problem running a script after no-ip update

Post by Joulinar »

yes could be a reason. Are you able to force a switch of the public IP address? At least on my internet router I can do this by forcing a reconnect or reboot. But this might depend on your ISP.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply