2024-09/helper/create_hosts_from_file.sh

16 lines
293 B
Bash
Raw Normal View History

2024-09-20 13:59:46 +00:00
#!/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