Skip to content

Commit 746c697

Browse files
committed
ddns-scripts: add namesilo.com
1 parent afce316 commit 746c697

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

net/ddns-scripts/Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ define Package/ddns-scripts-godaddy/description
125125
endef
126126

127127

128+
define Package/ddns-scripts-namesilo
129+
$(call Package/ddns-scripts/Default)
130+
TITLE:=Extension for namesilo.com API v1
131+
DEPENDS:=ddns-scripts +wget-ssl
132+
PROVIDES:=ddns-scripts_namesilo.com-v1
133+
endef
134+
135+
define Package/ddns-scripts-namesilo/description
136+
Dynamic DNS Client scripts extension for 'namesilo.com API v1'.
137+
endef
138+
139+
128140
define Package/ddns-scripts-digitalocean
129141
$(call Package/ddns-scripts/Default)
130142
TITLE:=Extention for digitalocean.com API v2
@@ -437,6 +449,7 @@ define Package/ddns-scripts-services/install
437449
rm $(1)/usr/share/ddns/default/cloud.google.com-v1.json
438450
rm $(1)/usr/share/ddns/default/freedns.42.pl.json
439451
rm $(1)/usr/share/ddns/default/godaddy.com-v1.json
452+
rm $(1)/usr/share/ddns/default/namesilo.com-v1.json
440453
rm $(1)/usr/share/ddns/default/digitalocean.com-v2.json
441454
rm $(1)/usr/share/ddns/default/ovh.com.json
442455
rm $(1)/usr/share/ddns/default/dnspod.cn.json
@@ -561,6 +574,25 @@ exit 0
561574
endef
562575

563576

577+
define Package/ddns-scripts-namesilo/install
578+
$(INSTALL_DIR) $(1)/usr/lib/ddns
579+
$(INSTALL_BIN) ./files/usr/lib/ddns/update_namesilo_com_v1.sh \
580+
$(1)/usr/lib/ddns
581+
582+
$(INSTALL_DIR) $(1)/usr/share/ddns/default
583+
$(INSTALL_DATA) ./files/usr/share/ddns/default/namesilo.com-v1.json \
584+
$(1)/usr/share/ddns/default
585+
endef
586+
587+
define Package/ddns-scripts-namesilo/prerm
588+
#!/bin/sh
589+
if [ -z "$${IPKG_INSTROOT}" ]; then
590+
/etc/init.d/ddns stop
591+
fi
592+
exit 0
593+
endef
594+
595+
564596
define Package/ddns-scripts-digitalocean/install
565597
$(INSTALL_DIR) $(1)/usr/lib/ddns
566598
$(INSTALL_BIN) ./files/usr/lib/ddns/update_digitalocean_com_v2.sh \
@@ -889,6 +921,7 @@ $(eval $(call BuildPackage,ddns-scripts-cloudflare))
889921
$(eval $(call BuildPackage,ddns-scripts-gcp))
890922
$(eval $(call BuildPackage,ddns-scripts-freedns))
891923
$(eval $(call BuildPackage,ddns-scripts-godaddy))
924+
$(eval $(call BuildPackage,ddns-scripts-namesilo))
892925
$(eval $(call BuildPackage,ddns-scripts-digitalocean))
893926
$(eval $(call BuildPackage,ddns-scripts-ovh))
894927
$(eval $(call BuildPackage,ddns-scripts-dnspod))
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
#.Distributed under the terms of the GNU General Public License (GPL) version 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.$domain</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 && {
25+
return 0
26+
}
27+
28+
return 1
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)