Add systemd scripts and instructions
This commit is contained in:
19
Makefile
Normal file
19
Makefile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
install:
|
||||||
|
cp hetzner-ddns.py /usr/local/bin
|
||||||
|
cp etc/hetzner-ddns.conf.example /etc
|
||||||
|
cp etc/systemd/hetzner-ddns.service /etc/systemd/system/
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm /usr/local/bin/hetzner-ddns.py
|
||||||
|
rm /etc/hetzner-ddns.conf.example
|
||||||
|
rm /etc/systemd/system/hetzner-ddns.service
|
||||||
|
|
||||||
|
enable:
|
||||||
|
systemctl enable hetzner-ddns
|
||||||
|
|
||||||
|
disable:
|
||||||
|
systemctl disable hetzner-ddns
|
||||||
|
|
||||||
|
start:
|
||||||
|
systemctl start hetzner-ddns
|
||||||
|
|
||||||
31
README.md
31
README.md
@@ -24,6 +24,35 @@ Options:
|
|||||||
--disable-v6 Do not update IPv6 address
|
--disable-v6 Do not update IPv6 address
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Running during boot
|
||||||
|
|
||||||
|
The instructions below were tested on Ubuntu Linux 20.04 LTS.
|
||||||
|
|
||||||
|
1. Install `python3` and `pip`:
|
||||||
|
|
||||||
|
apt install python3
|
||||||
|
|
||||||
|
2. Install package dependencies:
|
||||||
|
|
||||||
|
pip install docopt
|
||||||
|
|
||||||
|
3. Clone the repository somewhere:
|
||||||
|
|
||||||
|
cd /opt
|
||||||
|
git clone https://github.com/iSoron/hetzner-ddns.git
|
||||||
|
|
||||||
|
4. Install the script system-wide:
|
||||||
|
|
||||||
|
cd hetzner-ddns
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
5. Create a configuration file in `/etc/hetzner-ddns.conf` with you API token. See `/etc/hetzner-ddns.conf.example` for an example.
|
||||||
|
|
||||||
|
6. Run script and enable it during boot:
|
||||||
|
|
||||||
|
systemctl start hetzner-ddns
|
||||||
|
systemctl enable hetzner-ddns
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
|
|||||||
11
etc/systemd/hetzner-ddns.service
Normal file
11
etc/systemd/hetzner-ddns.service
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Hetzner Dynamic DNS Updater
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/local/bin/hetzner-ddns.py
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user