From 29237d11852b2cf03933af7d4a9935744830008e Mon Sep 17 00:00:00 2001 From: pks Date: Sat, 14 Nov 2020 12:03:54 +0100 Subject: generate-openwrt-hosts: for router --- generate-openwrt-hosts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/generate-openwrt-hosts b/generate-openwrt-hosts index 4c9f43a..5816bd7 100755 --- a/generate-openwrt-hosts +++ b/generate-openwrt-hosts @@ -1,9 +1,12 @@ #!/usr/bin/env zsh -cat hardware.csv | cut -d, -f 1,5 | grep -v TODO | grep -v name | grep -v ipmi | grep -v wired | while read line; do +cat hardware.csv | cut -d, -f 1,4,5 | grep -v TODO | grep -v name | while read line; do NAME=$(echo $line | cut -d, -f 1) - MAC=$(echo $line | cut -d, -f 2) + IPSUFF=$(echo $line | cut -d, -f 2 | cut -d. -f 1) + MAC=$(echo $line | cut -d, -f 3) echo "config host" echo "\toption name '$NAME'" echo "\toption mac '$MAC'" + echo "\toption ip '10.0.0.$IPSUFF'" + echo "\toption dns '1'" done -- cgit v1.2.3