freyanet/share/inet2.sh

23 lines
352 B
Bash
Raw Normal View History

2023-12-30 20:23:30 +00:00
#!/usr/bin/env sh
run() {
printf '$ \x1b[32;1m%s\x1b[0m\n' "$*"
"$@"
}
step() {
printf '\x1b[34;1m>> %s\x1b[0m\n' "$*"
}
getval() {
2024-11-17 04:01:08 +00:00
${INET2_PREFIX}/share/inet2/config.awk /etc/inet2.conf "$@"
2023-12-30 20:23:30 +00:00
}
haskey() {
getval interface | while read -r inter; do
if getval "interface $inter" "$1"; then
echo "true"
return
fi
done
}