From cb391948ce3d0fb7d7531e61046aff334eff7e87 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 4 Nov 2024 15:56:56 +0800 Subject: [PATCH] bugfix --- README.md | 19 ++++++++++++++++++- requirements.txt | 1 + script/config.example.json | 19 +++++++++++++++++++ script/run.sh | 5 +++++ script/ydns.service | 10 ++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 requirements.txt create mode 100644 script/config.example.json create mode 100755 script/run.sh create mode 100644 script/ydns.service diff --git a/README.md b/README.md index 6b87d8b..d99e84d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ -# ddns +# ydns + +## Dependents +ddns +``` +pip install ddns +``` + +## Installation + +``` +cd script +sudo cp ydns.service /etc/systemd/system +sudo systemctl deamon-reload +sudo systemctl enable ydns +sudo systemctl start ydns +``` + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..49ef5c9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +ddns diff --git a/script/config.example.json b/script/config.example.json new file mode 100644 index 0000000..d23a228 --- /dev/null +++ b/script/config.example.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://ddns.newfuture.cc/schema/v2.8.json", + "debug": false, + "dns": "dnspod", + "id": "YOUR ID or EMAIL for DNS Provider", + "index4": "default", + "index6": "default", + "ipv4": [ + "newfuture.cc", + "ddns.newfuture.cc" + ], + "ipv6": [ + "newfuture.cc", + "ipv6.ddns.newfuture.cc" + ], + "proxy": null, + "token": "YOUR TOKEN or KEY for DNS Provider", + "ttl": null +} \ No newline at end of file diff --git a/script/run.sh b/script/run.sh new file mode 100755 index 0000000..4726fe5 --- /dev/null +++ b/script/run.sh @@ -0,0 +1,5 @@ +while [ "1" = "1" ] +do + ddns -c /etc/ydns.conf + sleep 60 +done diff --git a/script/ydns.service b/script/ydns.service new file mode 100644 index 0000000..53c46c0 --- /dev/null +++ b/script/ydns.service @@ -0,0 +1,10 @@ +[Unit] +Description=dynamic dns service +Wants=systemd-networkd.service + +[Service] +Type=forking +ExecStart=su - ymq -c "/home/ymq/py/ydns/script/run.sh &" +[Install] +WantedBy=multi-user.target +