|
发表于 2004-11-17 17:34:12
|
显示全部楼层
可以在 /etc/profile 中加入如下检测
me=$(whoami)
cnt=$(who | grep "^$me" | wc -l)
if [ "$cnt" -qt 1 ];
then
echo "there is a session logged in, wait for it logout..."
while [ $(who | grep "^$me" | wc -l) -eq 1 ];
do
sleep(10);
done
fi
没测试,就不知道行不行,希望有所帮助吧. |
|