Commit 801f95c5 authored by Michael Völske's avatar Michael Völske

add util/list-buw-dns

parent c3cb00e1
#!/usr/bin/env bash
# List all assigned Webis host names / IP addresses at BUW
#
# Copyright 2018-today
#
# Project WEBIS
# Author: Michael Völske
#
# Permanent settings.
# Load libaries and toolkits.
scriptPath=${0%/*}
. "$scriptPath"/../../libs/bashhelper.sh
. "$scriptPath"/../../libs/shflags
check_tools "dig" "xargs"
# Define usage screen.
usage() {
echo "
Usage:
$(basename "$0")
Description:
List all assigned Webis host names / IP addresses in the BUW DNS.
"
exit 0
}
# Define command line arguments and parse them.
export FLAGS_HELP=$(usage)
FLAGS "$@" || exit 0
eval set -- "${FLAGS_ARGV}"
main() {
seq 255 \
| xargs -I @ \
printf \
'pcstein%d\nwebis%d\nwebismng%d\nalphaweb%02d\nbetaweb%03d\ngammaweb%02d\ndeltaweb%03d\nwebislab%d\nalphamng%02d\nbetamng%03d\ngammamng%02d\ndeltamng%03d\n' \
@ @ @ @ @ @ @ @ @ @ @ @ \
| xargs -I % echo %.medien.uni-weimar.de | xargs -P0 -I% bash -c 'echo -e %"\t"$( dig +short % ) | grep "[0-9]\$"' | sort -V
}
# Start program with parameters.
main "$@"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment