Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!usc!ucsd!ucsdhub!hp-sdd!ncr-sd!ncrlnk!ncrcce!mercer From: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer) Newsgroups: comp.sys.ncr Subject: Re: startup menu and changing the system time/date Message-ID: <1879@ncrcce.StPaul.NCR.COM> Date: 10 Feb 90 18:06:39 GMT References: <2290@texbell.swbt.com> <213@harald.UUCP> Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer) Organization: NCR Comten, Inc. Lines: 94 Keywords: In article <213@harald.UUCP> jba@harald.ruc.dk (Jan B. Andersen) writes: :I have written a script, bdate, which gets called at the bottom of :/etc/bcheckrc. It's not a menu, but it works fine for us. : :--------------[ /etc/bdate ]------------ :dig2() :{ : if [ $1 -lt 10 ] : then digits="0"`expr $1 + 0` : else digits=$1 : fi :} : :TZ=DNT-1DST :export TZ : :echo "\nSETTING System Date And Time\n" : :ls -l > /dev/null; echo "\007\c" :ls -l > /dev/null; echo "\007\c" :ls -l > /dev/null; echo "\007\c" : :echo "\nThe current date and time is : `date` \n" : :echo "Is the above information correct?\c" :echo "\tEnter \"y\" for yes or \"n\" for no : \007\c" : :read answer :if [ $answer = n ] :then : set `date "+%m %d %H %M %y"` : m=$1 d=$2 h=$3 n=$4 y=$5 : newdt= : : echo "\nEnter the month\t\t[$m] \c" : read val ; dig2 ${val:-$m} ; newdt=$digits : : echo "Enter the day\t\t[$d] \c" : read val ; dig2 ${val:-$d} ; newdt=${newdt}$digits : : echo "Enter the hour\t\t[$h] \c" : read val ; dig2 ${val:-$h} ; newdt=${newdt}$digits : : echo "Enter the minute\t[$n] \c" : read val ; dig2 ${val:-$n} ; newdt=${newdt}$digits : : echo "Enter the year\t\t[$y] \c" : read val ; dig2 ${val:-$y} ; newdt=${newdt}$digits :fi :date $newdt >/dev/null : :case $? in :0) : echo "\nThe new date and time is : `date` \n" : ;; :*) : $0 :esac Am I missing something in this thread or are people actually shutting their Towers down daily. I can imagine some circumstances when that might be necessary - in an environment in which the power is shut off nightly, or where the air conditioning is shut off for any length of time. Other than that, it seems an extraordinary thing to do. We bring ours down only to change the kernel or to clear up catastrophic errors (like yesterday, when I munged two ports due to a slight programming error (mine, unfortunately)). As for the person doing startup not having the same password as the system administrator, our policy is that all the root accounts (root - startup - sa or va - shutdown - multi - single) have the same password, since any one of them has the power to do major damage. As for changing the date, log in as root (in single user mode is preferable, or you may confuse running programs), and enter: date 0209143290 for instance to set the date to Feb 9, 1990 2:32 PM format is mmddhhmm[yy] - month(2 places)day(2 places)hour(2 places in 24 hour notation)minutes(2 places)and optionally the year(2 places). Disclaimer: I do not represent the opinions of anyone in NCR's Tower Division - I am just a happy user. After finally seeing what some other vendors deliver as UNIX - a very happy user. -- Dan Mercer Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer)