home *** CD-ROM | disk | FTP | other *** search
/ ftp.jcu.edu.au / 2014.06.ftp.jcu.edu.au.tar / ftp.jcu.edu.au / v6.3.2b / SWBD63 / fabos-6.3.2b-10.ppc.rpm / fabos-6.3.2b.10.cpio.gz / fabos-6.3.2b.10.cpio / fabos / bin / pdcheck_errs.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2010-11-10  |  1KB  |  56 lines

  1. #!/bin/sh
  2. #
  3. # This script, usually run once during system startup from /etc/inittab,
  4. # Checks for an existane of a panicdump in devices such as MTD.
  5. # If found, and if newer than the one found under /core_files/panic/
  6. # then it copies the panicdump from MTD to destination directory.
  7. #
  8.  
  9. BIN=/fabos/cliexec/
  10. PD_SUCCESS=0
  11.  
  12. # core files and now pd location. This is a directory name
  13. CORE_FILES_DIR=/core_files/    # The place where we store panicdump
  14.                 # which is same for core files
  15.                 # see savecore also, where this is used
  16.  
  17. PD_DIR=$CORE_FILES_DIR/panic/
  18.  
  19. # pd Control file. Will contain all the control date related to pd.
  20. # It contains the time-stamp of pd.
  21. # Note: this time-stamp is the time retrived from MTD and NOT the
  22. # current time, when we saved this
  23. PD_CTRL_FILE=/etc/.pd_data    # We will NOT store this in $CORE_FILES
  24.                 # This is because the existance is NOT
  25.                 # gauranteed and an user may choose to
  26.                 # delete $CORE_FILES_DIR. But we need
  27.                 # this time stamp
  28. PD_TEMP_ERRLOG_FILE=/tmp/pd_temp_errlog
  29.  
  30.  
  31. Debug=printf
  32. #
  33. #    Function used to check for a presence of a dumpfile
  34. #    if new pd found, record the date in $mtd_ts and return 1
  35. #    returns 0 otherwise
  36. #
  37. if [ ! -f $PD_TEMP_ERRLOG_FILE ]
  38. then
  39.     exit 0
  40. fi
  41. cat $PD_TEMP_ERRLOG_FILE | sed -e "/^[     ]*$/d" | \
  42. while [ 1 ]
  43. do
  44.     read oneLine
  45.     if [ -z "${oneLine}" ]
  46.     then
  47.         rm -f $PD_TEMP_ERRLOG_FILE
  48.         exit 0
  49.     fi
  50.     $BIN/errloginfo "${oneLine}"
  51. done
  52.  
  53. #    Invoke auto ftp
  54. /fabos/sbin/supportautoftp -f /core_files -d60 & >/dev/null 2>&1
  55.  
  56.