This commit is contained in:
yumoqing 2025-10-05 18:20:33 +08:00
parent e9028129b1
commit bab8a51503
2 changed files with 6 additions and 4 deletions

View File

@ -1,8 +1,9 @@
#!/usr/bin/bash #!/usr/bin/bash
cd
while [ "1" = "1" ] while [ "1" = "1" ]
do do
~/py3/bin/ddns --id LTAI5tCAGTfBwtCkLYoqj9S4 --token BdpB1Oz3jUKAXEL0pO0KNT6wLMIfto --ipv4 "kymoz.com" --debug --dns alidns --index4 url:https://www.kaiyuancloud.cn/ip ~/py3/bin/ddns --id LTAI5tCAGTfBwtCkLYoqj9S4 --token BdpB1Oz3jUKAXEL0pO0KNT6wLMIfto --ipv4 "kymoz.com" --debug --dns alidns --index4 url:https://sage.opencomputing.cn/ip
ret=$? ret=$?
echo $(date +"%Y-%m-%d %H:%M:%S"):ddns -c /etc/ydns.conf : exit $ret > ~/logs/ydns.log echo $(date +"%Y-%m-%d %H:%M:%S"):ddns -c /etc/ydns.conf : exit $ret > ~/logs/ydns.log
sleep 60 sleep 60

View File

@ -3,9 +3,10 @@ Description=dynamic dns service
Wants=systemd-networkd.service Wants=systemd-networkd.service
[Service] [Service]
Type=forking User=ymq
ExecStart=su - ymq -c "/home/ymq/py/ydns/script/run.sh &" Group=ymq
ExecStop=su - ymq -c "/home/ymq/bin/killname ydns/script/run.sh" ExecStart=/home/ymq/py/ydns/script/run.sh
ExecStop=/home/ymq/py/ydns/script/stop.sh
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target