From 5549f662d63c1d016248e2b86422cae18a628a85 Mon Sep 17 00:00:00 2001 From: pks Date: Tue, 10 Nov 2020 12:22:24 +0100 Subject: generate-openwrt-hosts --- generate-openwrt-hosts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 generate-openwrt-hosts diff --git a/generate-openwrt-hosts b/generate-openwrt-hosts new file mode 100755 index 0000000..4c9f43a --- /dev/null +++ b/generate-openwrt-hosts @@ -0,0 +1,9 @@ +#!/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 + NAME=$(echo $line | cut -d, -f 1) + MAC=$(echo $line | cut -d, -f 2) + echo "config host" + echo "\toption name '$NAME'" + echo "\toption mac '$MAC'" +done -- cgit v1.2.3