home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 15 / hacker15 / 15_H4CK3R#15.ISO / linux_security / engarde / ENGARDE_COMMUNITY_FEINT.ISO / bin / save-config < prev    next >
Encoding:
Text File  |  2002-05-30  |  720 b   |  39 lines

  1. #! /bin/sh
  2.  
  3. if [ -z "$1" ]
  4. then
  5.     echo -n 'Enter floppy device [/dev/fd0]: '
  6.     read FLOPPY
  7.     if [ -z "$FLOPPY" ]; then FLOPPY=/dev/fd0; fi
  8. else
  9.     FLOPPY="$1"
  10. fi
  11.  
  12. if [ ! -b $FLOPPY ]
  13. then
  14.     echo $FLOPPY is not a block device.
  15.     exit 1
  16. fi
  17.  
  18. FILETYPE=`dd bs=1k count=1 if=$FLOPPY | file -`
  19. if echo $FILETYPE | grep -q "GNU tar archive"
  20. then
  21.     echo Replacing existing archive...
  22. else
  23.     if echo $FILETYPE | grep -q "data"
  24.     then
  25.     echo Replacing junk on floppy...
  26.     else
  27.     echo There is something on the floppy: `echo $FILETYPE | cut -d: -f2-`
  28.     echo -n 'Destroy it? [N/y]: '
  29.     read ANSWER
  30.     if [ "$ANSWER" != "y" -a "$ANSWER" != "Y" ]
  31.     then
  32.         echo Aborting.
  33.         exit 1
  34.     fi
  35.     fi
  36. fi
  37.  
  38. tar cvpf $FLOPPY /etc
  39.