Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 1.1 KB

README.md

File metadata and controls

53 lines (43 loc) · 1.1 KB

Dynamic Ip

Description

Just a simple script that pings a 3rd party to find out if your ip changed every x amount of time. If it changes, it will update specified domains and records.
*Currently only supports digital ocean

Installation

Create a file called config-local.js at the root of the project:

module.exports = {
    'debug': true,
    'digitalOceanToken': 'xxx',
    'domains': [
        {
            'domain': 'foo.com',
            'records': ['bar', 'baz']
        }
    ]
}

Then run:

npm install

Hooking it up with systemd

Clone the project in your home dir and install the dependencies:

cd ~
git clone [email protected]:cmseguin/dynamic-ip.git
mv ~/dynamic-ip ~/.dynamic-ip
cd ~/.dynamic-ip
npm install --production

Create a file in /etc/systemd/system called dynamic-ip.service

[Unit]
Description=A script to update one or more domains record to point to a non-static ip address

[Service]
WorkingDirectory=/home/{user}
ExecStart=/usr/local/bin/node /home/{user}/.dynamic-ip/index.js
Restart=on-abort

[Install]
WantedBy=multi-user.target