summaryrefslogtreecommitdiff
path: root/templates/service
diff options
context:
space:
mode:
Diffstat (limited to 'templates/service')
-rw-r--r--templates/service/dns/dynamic/interface/node.def31
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/service/node.def23
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/service/node.tag/host-name/node.def3
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/service/node.tag/login/node.def2
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/service/node.tag/password/node.def2
-rw-r--r--templates/service/dns/dynamic/node.def2
6 files changed, 63 insertions, 0 deletions
diff --git a/templates/service/dns/dynamic/interface/node.def b/templates/service/dns/dynamic/interface/node.def
new file mode 100644
index 00000000..bbf0c310
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.def
@@ -0,0 +1,31 @@
+tag:
+help: Set interface to send DDNS updates for
+type: txt
+syntax:expression: exec "
+ intf_array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev))
+ intf_array_len=${#intf_array[*]}
+ i=0
+ while [ $i -lt $intf_array_len ]; do
+ temp=${intf_array[$i]%:*}
+ if [ \"$temp\" == \"$VAR(@)\" ] ; then
+ exit 0
+ fi
+ let i++
+ done
+ echo Invalid interface [$VAR(@)]
+ exit 1 "
+
+allowed: local -a array ;
+ array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev));
+ echo -n ${array[@]%:*}
+
+commit:expression: $VAR(./@/service/@@) != ""; "Atleast one service must be set to send DDNS updates for $VAR(@)"
+
+delete:expression: "touch /tmp/ddclient_$VAR(@).$PPID"
+
+end:expression: "if [ -f \"/tmp/ddclient_$VAR(@).$PPID\" ]; then \
+ sudo /opt/vyatta/sbin/vyatta-dynamic-dns.pl --stop-dynamicdns --interface $VAR(@) \
+ rm /tmp/ddclient_$VAR(@).$PPID; \
+ else \
+ sudo /opt/vyatta/sbin/vyatta-dynamic-dns.pl --update-dynamicdns --interface $VAR(@); \
+ fi; "
diff --git a/templates/service/dns/dynamic/interface/node.tag/service/node.def b/templates/service/dns/dynamic/interface/node.tag/service/node.def
new file mode 100644
index 00000000..a515351e
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/service/node.def
@@ -0,0 +1,23 @@
+tag:
+help: Set service being used for Dynamic DNS
+type: txt
+syntax:expression: exec "
+ service_array=(dnspark dslreports dyndns easydns namecheap sitelutions zoneedit)
+ service_array_len=${#service_array[*]}
+ i=0
+ while [ $i -lt $service_array_len ]; do
+ if [ \"${service_array[$i]}\" == \"$VAR(@)\" ] ; then
+ exit 0
+ fi
+ let i++
+ done
+ echo Invalid service [$VAR(@)]
+ exit 1 "
+
+allowed: local -a array ;
+ array=(dnspark dslreports dyndns easydns namecheap sitelutions zoneedit);
+ echo -n ${array[@]}
+
+commit:expression: $VAR(./@/login) != ""; "Set login for service $VAR(./@) to send DDNS updates for interface $VAR(../@)"
+commit:expression: $VAR(./@/password) != ""; "Set password for service $VAR(./@) to send DDNS updates for interface $VAR(../@)"
+commit:expression: $VAR(./@/host-name) != ""; "Set atleast one host-name registered with service $VAR(./@) to send DDNS updates for interface $VAR(../@)"
diff --git a/templates/service/dns/dynamic/interface/node.tag/service/node.tag/host-name/node.def b/templates/service/dns/dynamic/interface/node.tag/service/node.tag/host-name/node.def
new file mode 100644
index 00000000..e104ae8f
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/service/node.tag/host-name/node.def
@@ -0,0 +1,3 @@
+multi:
+help: Set host-name registered with DDNS service
+type: txt
diff --git a/templates/service/dns/dynamic/interface/node.tag/service/node.tag/login/node.def b/templates/service/dns/dynamic/interface/node.tag/service/node.tag/login/node.def
new file mode 100644
index 00000000..4a6ca920
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/service/node.tag/login/node.def
@@ -0,0 +1,2 @@
+help: Set login for DDNS service
+type: txt
diff --git a/templates/service/dns/dynamic/interface/node.tag/service/node.tag/password/node.def b/templates/service/dns/dynamic/interface/node.tag/service/node.tag/password/node.def
new file mode 100644
index 00000000..9dceae00
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/service/node.tag/password/node.def
@@ -0,0 +1,2 @@
+help: Set password for DDNS service
+type: txt
diff --git a/templates/service/dns/dynamic/node.def b/templates/service/dns/dynamic/node.def
new file mode 100644
index 00000000..d713fc1c
--- /dev/null
+++ b/templates/service/dns/dynamic/node.def
@@ -0,0 +1,2 @@
+help: Configure Dynamic DNS
+commit:expression: $VAR(./interface/@@) != ""; "Atleast one interface must be set to send DDNS updates for"