ditching ansible, using local script

This commit is contained in:
2021-02-08 11:44:21 +01:00
parent 0819d676cf
commit 33d738a69f
4 changed files with 41 additions and 71 deletions

14
localeval.sh Normal file
View File

@@ -0,0 +1,14 @@
#! /bin/bash
source functions.sh
# check that alias has been tried
echo -ne "host\tname\t<+CHANGEME+>\n"
for host in /srv/lxc/epsi/b1/* ; do
root=${host}/rootfs
host=$(basename $host)
hostname=$(grep HOSTNAME ${root}/etc/sysconfig/network | cut -f2 -d=)
test -f ${root}/etc/motd && user="$(cat ${root}/etc/motd | sed 's/\n//')\t"
echo -ne "${hostname}\t${user}"
<+CHANGEME+>
echo
done