Skip to content

Allows cf-ddns.py to open conf file from own directory#4

Open
anchepiece wants to merge 1 commit intoAmirAzodi:masterfrom
anchepiece:patch-1
Open

Allows cf-ddns.py to open conf file from own directory#4
anchepiece wants to merge 1 commit intoAmirAzodi:masterfrom
anchepiece:patch-1

Conversation

@anchepiece
Copy link

When running from cron, instead of changing the working directory to the script location, this commit will source the conf file from the script's own directory automatically.

For example, if your crontab entry looks like this:
/home/user/bin/cf-ddns.py
you may get a file not found error
IOError: [Errno 2] No such file or directory: 'cf-ddns.conf'

Here we save the script location and then use that to build the patch to the conf file directly.

Hope this helps!

When running from cron, instead of changing the working directory to the script location, this commit will source the conf file from the script's own directory automatically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant