2024-11/helper/create_hosts_from_file.sh
2024-11-26 11:41:41 +01:00

16 lines
293 B
Bash
Executable file

#!/bin/bash
if [ -z "$1" -o ! -f "$1" ]; then
echo Need filename
exit 1
fi
for GROUP in alpine archlinux centos debian devuan fedora oracle opensuse ubuntu voidlinux
do
grep "${GROUP}" "$1" | while read NAME IP REST
do
echo -e "${IP}\t${NAME}.heinlein.akademie\t\t${NAME}"
done
done