Fixed lease of IP address

Hi all,
I need to add 80 fixed leases to my RUT. Instead of typing them in one by one, is there any way to create and run a script that import a txt file? I have a txt file with IP, MAC and hostname.

HW: RUT950
FW: RUT9_R_00.07.06.16

Hello,
Create a file named genleases.awk containing:

/./ {
	print "config host"
	print "\toption mac '" $2 "'"
	print "\toption name '" $3 "'"
	print "\toption ip '" $1 "'"
	print ""
}

With IP MAC name in this order separated by spaces in parmfile.txt execute:

awk -f ./genleases.awk parmfile.txt >> /etc/config/dhcp
service dnsmasq restart

Regards,

This topic was automatically closed after 15 days. New replies are no longer allowed.