summaryrefslogtreecommitdiff
path: root/share/inet2.sh
blob: 73bd279f03f71c5117a1ec4e8a2e8c27a9c4b3d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env sh

run() {
  printf '$ \x1b[32;1m%s\x1b[0m\n' "$*"
  "$@"
}
step() {
  printf '\x1b[34;1m>> %s\x1b[0m\n' "$*"
}

getval() {
  ${INET2_PREFIX}/share/inet2/config.awk /etc/inet2.conf "$@"
}

haskey() {
  getval interface | while read -r inter; do
    if getval "interface $inter" "$1"; then
      echo "true"
      return
    fi
  done
}