Update 'DynDNS/install.sh'
This commit is contained in:
parent
8a6853bd41
commit
27552639eb
|
@ -1,18 +1,24 @@
|
|||
# Download lua script
|
||||
wget https://git.znachor.cz/znachor/OpenWrt-Tools/raw/branch/master/DynDNS/dyndns.lua -O /root/dyndns.lua
|
||||
# Download scripts
|
||||
mkdir /root/dyndns
|
||||
wget https://git.znachor.cz/znachor/OpenWrt-Tools/raw/branch/master/DynDNS/ip.lua -O /root/dyndns/ip.lua
|
||||
wget https://git.znachor.cz/znachor/OpenWrt-Tools/raw/branch/master/DynDNS/dyndns.lua -O /root/dyndns/dyndns.lua
|
||||
|
||||
# Download lua bit library
|
||||
opkg update
|
||||
opkg install luabitop
|
||||
|
||||
# Set local domain
|
||||
domain=$(uci get dhcp.@dnsmasq[0].domain)
|
||||
sed -i "s/.lan/.$domain/gi" /root/dyndns.lua
|
||||
sed -i "s/.lan/.$domain/gi" /root/dyndns/dyndns.lua
|
||||
|
||||
# Create dhcp script
|
||||
echo "lua /root/dyndns.lua" > /root/dyndns.sh
|
||||
echo "cd /root/dyndns/ && lua dyndns.lua" > /root/dyndns/dyndns.sh
|
||||
|
||||
# Allow execution
|
||||
chmod +x /root/dyndns.*
|
||||
chmod +x /root/dyndns/*.*
|
||||
|
||||
# Add dhcpscript to the config
|
||||
uci set dhcp.@dnsmasq[0].dhcpscript='/root/dyndns.sh'
|
||||
uci set dhcp.@dnsmasq[0].dhcpscript='/root/dyndns/dyndns.sh'
|
||||
|
||||
# Add addnlist to the config
|
||||
uci set dhcp.@dnsmasq[0].addnhosts='/tmp/dyndns'
|
||||
|
|
Loading…
Reference in a new issue