Skip to content

Commit 530a7ff

Browse files
committed
ddns-scripts: add namesilo.com
new service provider namesilo.com config guide: * set [domain] to apex domain * set [username] to subdomain (without apex domain) * set [password] to api key Signed-off-by: Lin Fan <[email protected]>
1 parent afce316 commit 530a7ff

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

net/ddns-scripts/Makefile

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
88

99
PKG_NAME:=ddns-scripts
1010
PKG_VERSION:=2.8.2
11-
PKG_RELEASE:=81
11+
PKG_RELEASE:=82
1212

1313
PKG_LICENSE:=GPL-2.0
1414

@@ -124,6 +124,16 @@ define Package/ddns-scripts-godaddy/description
124124
Dynamic DNS Client scripts extension for 'godaddy.com API v1'.
125125
endef
126126

127+
define Package/ddns-scripts-namesilo
128+
$(call Package/ddns-scripts/Default)
129+
TITLE:=Extension for namesilo.com API v1
130+
DEPENDS:=ddns-scripts +wget-ssl
131+
PROVIDES:=ddns-scripts_namesilo.com-v1
132+
endef
133+
134+
define Package/ddns-scripts-namesilo/description
135+
Dynamic DNS Client scripts extension for 'namesilo.com API v1'.
136+
endef
127137

128138
define Package/ddns-scripts-digitalocean
129139
$(call Package/ddns-scripts/Default)
@@ -437,6 +447,7 @@ define Package/ddns-scripts-services/install
437447
rm $(1)/usr/share/ddns/default/cloud.google.com-v1.json
438448
rm $(1)/usr/share/ddns/default/freedns.42.pl.json
439449
rm $(1)/usr/share/ddns/default/godaddy.com-v1.json
450+
rm $(1)/usr/share/ddns/default/namesilo.com-v1.json
440451
rm $(1)/usr/share/ddns/default/digitalocean.com-v2.json
441452
rm $(1)/usr/share/ddns/default/ovh.com.json
442453
rm $(1)/usr/share/ddns/default/dnspod.cn.json
@@ -560,6 +571,23 @@ fi
560571
exit 0
561572
endef
562573

574+
define Package/ddns-scripts-namesilo/install
575+
$(INSTALL_DIR) $(1)/usr/lib/ddns
576+
$(INSTALL_BIN) ./files/usr/lib/ddns/update_namesilo_com_v1.sh \
577+
$(1)/usr/lib/ddns
578+
579+
$(INSTALL_DIR) $(1)/usr/share/ddns/default
580+
$(INSTALL_DATA) ./files/usr/share/ddns/default/namesilo.com-v1.json \
581+
$(1)/usr/share/ddns/default
582+
endef
583+
584+
define Package/ddns-scripts-namesilo/prerm
585+
#!/bin/sh
586+
if [ -z "$${IPKG_INSTROOT}" ]; then
587+
/etc/init.d/ddns stop
588+
fi
589+
exit 0
590+
endef
563591

564592
define Package/ddns-scripts-digitalocean/install
565593
$(INSTALL_DIR) $(1)/usr/lib/ddns
@@ -889,6 +917,7 @@ $(eval $(call BuildPackage,ddns-scripts-cloudflare))
889917
$(eval $(call BuildPackage,ddns-scripts-gcp))
890918
$(eval $(call BuildPackage,ddns-scripts-freedns))
891919
$(eval $(call BuildPackage,ddns-scripts-godaddy))
920+
$(eval $(call BuildPackage,ddns-scripts-namesilo))
892921
$(eval $(call BuildPackage,ddns-scripts-digitalocean))
893922
$(eval $(call BuildPackage,ddns-scripts-ovh))
894923
$(eval $(call BuildPackage,ddns-scripts-dnspod))
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# SPDX-License-Identifier: GPL-2.0
3+
#
4+
# using following options from /etc/config/ddns
5+
# option username - sub domain
6+
# option password - api key
7+
# option domain - domain
8+
#
9+
# variable __IP already defined with the ip-address to use for update
10+
#
11+
12+
__TTL=3600
13+
14+
# wrap some routines
15+
call_api() {
16+
wget -q -O- "https://www.namesilo.com/api/$1?version=1&type=xml&key=$password&$2"
17+
}
18+
get_rrid() {
19+
grep -o "<record_id>.*$username</host>" | sed 's/.*<record_id>//g;s/<.*//g'
20+
}
21+
22+
# update subdomain record
23+
rrid=$(call_api dnsListRecords "domain=$domain" | get_rrid)
24+
call_api dnsUpdateRecord "domain=$domain&rrid=$rrid&rrhost=$username&rrvalue=$__IP&rrttl=$__TTL" | grep success
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "namesilo.com",
3+
"ipv4": {
4+
"url": "update_namesilo_com_v1.sh"
5+
},
6+
"ipv6": {
7+
"url": "update_namesilo_com_v1.sh"
8+
}
9+
}

0 commit comments

Comments
 (0)