freyanet/lib/inet2.sh
2023-12-30 15:23:30 -05:00

23 lines
339 B
Bash
Executable file

#!/usr/bin/env sh
run() {
printf '$ \x1b[32;1m%s\x1b[0m\n' "$*"
"$@"
}
step() {
printf '\x1b[34;1m>> %s\x1b[0m\n' "$*"
}
getval() {
/var/lib/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
}