7 # Find the non-local logins, probably on ttyp etc. Or on pts/N.
8 # grep -E is equivalent to egrep but does not exist everywhere
9 LOG="`w -s | egrep -v 'tty[0-9]' | tail +2`"
10 count=`echo "$LOG" | wc -l`
15 THE SYSTEM IS SHUTTING DOWN
19 !!!!DON'T POWER DOWN YET!!!!!!!!
21 wait for this message to clear.
27 if [ $count -lt 2 ]; then
29 The system is shutting down"
30 /sbin/shutdown -r now "sistema esta en shutdown"
33 There are the following users in
38 Shutdown will be delayed by 2 minutes
39 in order to warn the users.
41 Do you still want to start the shutdown?
43 " `expr 14 + $count` 70
48 Shutting down in 2 minutes"
49 /sbin/shutdown -r +2 "sistema esta en shutdown"
54 The shutdown has been aborted