Shell Scripts February 24, 2008 0

Root has logged in – Root się zalogował!!

  • This script is listening whether the root user (in this example) has logged in to the system:

#!/bin/sh   
#set a username 
USER=root   
until who | grep $USER > /dev/null 
do sleep 2 
done 

echo -e \a echo "**** $USER has logged in !! ****"     
#END-SCRIPT#