diff --git a/DynDNS/install.sh b/DynDNS/install.sh new file mode 100644 index 0000000..c2ed912 --- /dev/null +++ b/DynDNS/install.sh @@ -0,0 +1,21 @@ +# Download lua script +wget https://git.znachor.cz/znachor/OpenWrt-Tools/raw/branch/master/DynDNS/dyndns.lua -O /root/dyndns.lua + +# Set local domain +domain=$(uci get dhcp.@dnsmasq[0].domain) +sed -i "s/.lan/.$domain/gi" /root/dyndns.lua + +# Create dhcp script +echo "lua /root/dyndns.lua" > /root/dyndns.sh + +# Allow execution +chmod +x /root/dyndns.* + +# Add dhcpscript to the config +uci set dhcp.@dnsmasq[0].dhcpscript='/root/dyndns.sh' + +# Add addnlist to the config +uci set dhcp.@dnsmasq[0].addnhosts='/tmp/dyndns' + +# Reload dnsmasq +service dnsmasq reload \ No newline at end of file