Script below isnt working correctly, had wanted it to logout from the menu if no keystrokes for 30 minutes - can any one see where ive gone worong?
Thanks for your help in advance
#!/bin/sh
ok=0
while [ $ok -eq 0 ]; do
clear
cat <<__END
MENU
------------------------
Choose an option.
(1).
(2).
(3). Email.
(4).
(5). Lynx.
(6). Admin.
(15). Logout.
`logname` `date '+Terminal LAST USED: %H:%M:%S'`
__END
COUNTER=0
while [ $COUNTER -lt 30 ];
do
sleep 60
COUNTER=`echo "$COUNTER + 1"|bc`
if [ $COUNTER >29 ]
then
echo "you were idle too long"
ok=1
exit
fi
done
read ans
case "$ans" in
1)
echo
;;
2)
echo
;;
3)
echo Email. ; /appl/pine/pine
;;
4)
echo Generic. ; ./gen.sh
;;
15)
exit
;;
Thanks for your help in advance
#!/bin/sh
ok=0
while [ $ok -eq 0 ]; do
clear
cat <<__END
MENU
------------------------
Choose an option.
(1).
(2).
(3). Email.
(4).
(5). Lynx.
(6). Admin.
(15). Logout.
`logname` `date '+Terminal LAST USED: %H:%M:%S'`
__END
COUNTER=0
while [ $COUNTER -lt 30 ];
do
sleep 60
COUNTER=`echo "$COUNTER + 1"|bc`
if [ $COUNTER >29 ]
then
echo "you were idle too long"
ok=1
exit
fi
done
read ans
case "$ans" in
1)
echo
;;
2)
echo
;;
3)
echo Email. ; /appl/pine/pine
;;
4)
echo Generic. ; ./gen.sh
;;
15)
exit
;;