diff options
-rwxr-xr-x | generate-openwrt-hosts | 7 |
1 files 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 |