home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Timing / UpTime17.lha / UpTime / scripts / AtMidNite next >
Encoding:
Text File  |  1993-10-19  |  1.4 KB  |  57 lines

  1. ;
  2. ;   $VER: AtMidNite 1.0 (19.10.93)
  3. ;
  4. ;   Written 20. September 1993 by J.Matern
  5. ;   This file is part of the 'UpTime'-package © by Jürgen Matern.
  6. ;   The package may be redistributed under limitations discribed
  7. ;   in the file 'UpTime.doc' which should have come with this
  8. ;   distribution. Read this file for more information!
  9. ;
  10. ;   Last changed: 19. October 1993
  11. ;
  12. set LastBoot `date`
  13. if exists ENV:UpTime/LastBoot
  14.    set LastBoot `getenv UpTime/LastBoot`
  15. endif
  16. set NowBoot `date`
  17. set LastTime 0
  18. if exists ENV:UpTime/UpTime
  19.    set LastTime `getenv UpTime/UpTime`
  20. endif
  21. set UpFileName S:UpTime/UpTime.++
  22. if exists ENV:UpTime/UpFileName
  23.    set UpFileName `getenv UpTime/UpFileName`
  24. endif
  25.  
  26. set hours `eval $LastTime / 60`
  27. set minutes `eval $LastTime - ($hours * 60)`
  28. set LastTime `echo SystemUpTime: $hours h $minutes min.`
  29.  
  30. set LastBoot `S:CutArg $LastBoot`
  31.  
  32. echo >> $UpFileName $LastBoot $LastTime
  33.  
  34. set lastyear `echo $LastBoot len 2`
  35. set lastyear `echo "$lastyear" first 4 len 2`
  36. set nowyear `echo $NowBoot len 2`
  37. set nowyear `echo "$nowyear" first 4 len 2`
  38.  
  39. if $lastyear not eq $nowyear
  40.    S:NewFileNames
  41. endif
  42.  
  43. setenv UpTime/UpTime 0
  44. copy ENV:UpTime/UpTime ENVARC:UpTime/UpTime
  45. date > ENV:UpTime/LastBoot
  46. copy ENV:UpTime/LastBoot ENVARC:UpTime/LastBoot
  47. run < nil: > nil: updatedb ; Remove this line, if you don't use 'FIND'.
  48.  
  49. unset LastBoot
  50. unset NowBoot
  51. unset LastTime
  52. unset UpFileName
  53. unset hours
  54. unset minutes
  55. unset lastyear
  56. unset nowyear
  57.