remove user if not set
This commit is contained in:
@@ -4,9 +4,9 @@ IFS=$'\n\t'
|
|||||||
source functions.sh
|
source functions.sh
|
||||||
echo -ne "host;name;root history;bash history;<+CHANGEME+>\n"
|
echo -ne "host;name;root history;bash history;<+CHANGEME+>\n"
|
||||||
if [ $# -ge 1 ] ; then
|
if [ $# -ge 1 ] ; then
|
||||||
hostlist=/srv/lxc/epsi/b2/$1
|
hostlist=/srv/lxc/epsi/b3/
|
||||||
else
|
else
|
||||||
hostlist=/srv/lxc/epsi/b2/*
|
hostlist=/srv/lxc/epsi/b3/*
|
||||||
fi
|
fi
|
||||||
for host in $hostlist ; do
|
for host in $hostlist ; do
|
||||||
root=${host}/rootfs
|
root=${host}/rootfs
|
||||||
@@ -14,9 +14,10 @@ for host in $hostlist ; do
|
|||||||
hostname=$(grep HOSTNAME ${root}/etc/sysconfig/network 2>/dev/null| cut -f2 -d=)
|
hostname=$(grep HOSTNAME ${root}/etc/sysconfig/network 2>/dev/null| cut -f2 -d=)
|
||||||
test -z "${hostname}" && hostname=$(cat ${root}/etc/hostname)
|
test -z "${hostname}" && hostname=$(cat ${root}/etc/hostname)
|
||||||
test -f ${root}/etc/motd && user="$(cat ${root}/etc/motd | xargs)"
|
test -f ${root}/etc/motd && user="$(cat ${root}/etc/motd | xargs)"
|
||||||
|
test -z $user && continue
|
||||||
echo -ne "${hostname};${user};"
|
echo -ne "${hostname};${user};"
|
||||||
fileMTime ${root}/root/.bash_history
|
# fileMTime ${root}/root/.bash_history
|
||||||
fileMTime ${root}/home/formation/.bash_history
|
# fileMTime ${root}/home/formation/.bash_history
|
||||||
unset user
|
unset user
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user