Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows setup #2

Open
Baccanno opened this issue Sep 3, 2021 · 3 comments
Open

Windows setup #2

Baccanno opened this issue Sep 3, 2021 · 3 comments

Comments

@Baccanno
Copy link

Baccanno commented Sep 3, 2021

Hi their,
Thanks for this tool it works great after some tweak for me on windows

environment

  • curl (from git for windows or cygwin for instance)
  • Python installed with requests module

Error

'scripts\ipify' not recognized as internal command

Workaround

I simply added a ipify.bat with following content into scripts @sh -c "curl -s https://api.ipify.org/"

And all is set !

@Baccanno
Copy link
Author

Baccanno commented Sep 3, 2021

I will then install as a service thanks to NSSM

@hoot-w00t
Copy link
Owner

Hi,

Thank you for your feedback! 👍

Yes, on Windows you have to create a batch or Powershell script, the ones provided in the repository are made for Linux. If you add Cygwin's bin folder to yourPATH you can avoid having to call sh to invoke curl (as well as using other useful tools):

@curl -s https://api.ipify.org

I'll add some examples for Windows and mention it in the README as it currently only covers Linux.

About the service, I haven't played with Windows services but you could use the Task Scheduler to create a startup task for Dynhost.

@damien5701
Copy link

damien5701 commented Aug 13, 2022

Hello everyone,

First, thank you for your script, it's very useful.
Let me share my trick to install this on a windows server using the task scheduler.

  • Install requests module: pip3 install requests (can be different, depends on your python/pip installation)
  • Install chocolatey as individual: https://chocolatey.org/install : Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  • Install curl: choco install curl
  • Update ipify.bat, this line is enough: @curl -s https://api.ipify.org/
  • Change the last line of dyndns.py : sleep(update_delay) => exit(0) - If you don't change this, the script will be stuck at the end of the first execution. In addition, you can put "update_delay": 0 in the config file dynhost.json
  • Setup a scheduled task. In action, add the path to python. ex:
    program/script: C:\python\python.exe
    arguments: C:\ovh-dyndns\dynhost.py -c C:\ovh-dyndns\dynhost.json --scripts C:\ovh-dyndns\scripts
    start at: C:\ovh-dyndns
    Choose a recurrence and set the rest as you wish.

Now, you should be ready.

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

No branches or pull requests

3 participants