|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T u
Length: 1769 (0x6e9) Types: TextFile Names: »usr/admin/powerdown «
└─⟦3d8f416b2⟧ Bits:30004042/core2.imd SW95705I 386/ix Multi-user Release 1.2 └─⟦this⟧ »usr/admin/powerdown «
#ident "@(#)sadmin:admin/powerdown 2.2" # invoke /etc/shutdown and stop the system #help# #help# Powerdown will stop all running programs, close any open files, #help# write out information to disk (such as directory information), #help# then turn the machine power off. #! chmod +x ${file} trap 'exit 0' 1 2 15 flags="-qq -k$$" cd / case "$1" in -y ) grace=60 ;; -Y ) grace=0 ;; ?* ) echo >&2 "Usage: `basename $0` [ -y | -Y ] -y shutdown after 60 second warning -Y shutdown immediately" exit 1 ;; '' ) wholist=`who` if [ `echo "${wholist}" | wc -l` -gt 1 ] then echo "Users currently logged in:\\n${wholist}" fi if checkyn ${flags} -f -H' An express powerdown brings the system down as fast as possible and turns off the power. It is not a very friendly thing to do on a system with several users. Entering q will quit this procedure.' \ 'Once started, a powerdown CANNOT BE STOPPED. Do you want to start an express powerdown?' then grace=0 else grace=`checkre ${flags} -D60 -fe -H' There are 1 or 2 warning messages (depending on whether there is more than one user on the system) before the system is shut down. The delay you specify here is used between the messages and between the last message and the beginning of powerdown. Entering q will quit this procedure.' \ 'Enter the number of seconds to allow between the warning messages (default 60): [?, q]' \ '^[0-9]\{1,\}$' 'Must be all digits.' \ '^.\{1,4\}$' 'No more than 4 digits. That is good for over 2.7 hours.'` fi esac trap '' 1 2 3 15 setpgrp /etc/shutdown -y -g${grace} -i0 || exit 1 # A trick to keep the shell from announcing the death of a process and # yet keep the command from returning. sleep 1200& trap 'kill -9 0 2>/dev/null' 15 wait