diff options
author | Freya Murphy <freya@freyacat.org> | 2024-11-17 04:01:08 +0000 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-11-17 04:01:08 +0000 |
commit | 5e60794b428035db69899f229befac504d6dc043 (patch) | |
tree | 6135a66fcaad554b71f012f211e625f56faa787f /share/inet2.sh | |
parent | add openwrt (diff) | |
download | freyanet-5e60794b428035db69899f229befac504d6dc043.tar.gz freyanet-5e60794b428035db69899f229befac504d6dc043.tar.bz2 freyanet-5e60794b428035db69899f229befac504d6dc043.zip |
Diffstat (limited to 'share/inet2.sh')
-rwxr-xr-x | share/inet2.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/share/inet2.sh b/share/inet2.sh new file mode 100755 index 0000000..73bd279 --- /dev/null +++ b/share/inet2.sh @@ -0,0 +1,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 +} |