Files
eval_functions/localeval.sh

24 lines
663 B
Bash

#! /bin/bash
set -eu
IFS=$'\n\t'
source functions.sh
echo -ne "host;name;root history;bash history;<+CHANGEME+>\n"
if [ $# -ge 1 ] ; then
hostlist=/srv/lxc/epsi/b2/$1
else
hostlist=/srv/lxc/epsi/b2/*
fi
for host in $hostlist ; do
root=${host}/rootfs
host=$(basename $host)
hostname=$(grep HOSTNAME ${root}/etc/sysconfig/network 2>/dev/null| cut -f2 -d=)
test -z "${hostname}" && hostname=$(cat ${root}/etc/hostname)
test -f ${root}/etc/motd && user="$(cat ${root}/etc/motd | xargs)"
test -z "$user" && continue
echo -ne "${hostname};${user};"
fileMTime ${root}/root/.bash_history
fileMTime ${root}/home/formation/.bash_history
echo
done