summaryrefslogtreecommitdiff
path: root/generate-openwrt-hosts
blob: 5816bd74f7c549715b883c33bfc8a68be64b2300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env zsh

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)  
  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