...programming question.

Phil Jensen - News Administrator (phil@sierra.valleynet.com)
Wed, 8 Nov 1995 08:19:52 -0800 (PST)

Hi guys. I'm having a problem with a little shell program I wrote
a couple of days ago. I have successfully developed a multiple
login preventer, but my boss would like something that is a little more
flexible. My boss requires that this script be able to read from
a file of users that can have multiple logins. The below awk/shell
program will only support those login names in which you specify
in the script. Is there anyone who can help me with this? Thanks.

---Start program---

#!/bin/sh

/var/staff/tools/pmwho fresno1 | awk ' $1 ~ /S/ && $2 != "Pwebcity" && $2 != "webcity" && $2 != "guest" { print $1, $2 } ' | tee pmwho.out

sort -k 2 pmwho.out | uniq -d -f 1 | tee check.out

set `cat check.out`
for u
do

echo $1 $2
( echo "!root" ;
sleep 1;
echo "mypmpassword" ;
sleep 1;
echo "reset $1" ;
sleep 1 ) | telnet fresno1

login=`echo $2 | awk ' { gsub(/P/, "") ; print $0 } '`
cat /var/staff/tools/loginwatcher | /usr/sbin/sendmail $login
shift ; shift

done

---End program---

Sincerely,

Phil Jensen _\\|//_
News Administrator (-0-0-)
---------------------------------------------------------------ooO-(_)-Ooo----
ValleyNet Communications - Central California's Premier Internet Provider
------------------------------------------------------------------------------
Voice: (209) 486-VNET (8638) 2300 Tulare, Suite 100
Fax: (209) 495-4940 Fresno, CA 93721-2226
Data: (209) 495-4950 http://www.valleynet.com
==============================================================================