01-31-2002
n/a,
0
You would have to create a base file - this can be done on the fly in your script before you start checking on everyone.
In your script - who -u |awk '{print $1,$3}' - set a variable to these values. grep to see if the first $1 (the userid) is already in the file. If it is, do nothing but if it isn't write the userid and IP to the file.
Once you get a user id that is in the file and your script finds it in there, then you can start to compare the IP address.
UserIP-File format;
userid IP
joeuser 172.16.1.2
jackuser 172.16.1.3
janeuser 172.16.1.4
To compare what is on the system versus what is in the file, use your who -u command again, pulling the userid and IP into two variables. Check for the userid in the file - if it is there, compare the IP addresses. If different, then email yourself to check it out
You could do many more things with this...but I hope you get the idea.