rmdata.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. SCRIPT_VERSION="19.1($CT_BUILD_VERSION)"
  3. SCRIPT_NAME=${0}
  4. ##########################################################################################
  5. ## rmdata.sh v 19.1
  6. ## - scrub collected data of passwords or encryped information.
  7. ##
  8. ECHO_rmdata="echo_rmdata_print"
  9. ##############################################################
  10. # make echo more portable
  11. #
  12. echo_rmdata_print() {
  13. #IFS=" " command
  14. eval 'printf "%b\n" "$*"'
  15. }
  16. ##############################################################
  17. # make echo more portable
  18. #
  19. echo_rmdata_log() {
  20. $ECHO_rmdata "$1"
  21. $ECHO_rmdata "$1" >> $2
  22. }
  23. $ECHO_rmdata "\nRemoving passwords and encrypted information..."
  24. old_IFS=$IFS # save the field separator
  25. # new field separator, the end of line
  26. IFS='
  27. '
  28. if [ -f $CT_TMP/logs/CTRMDATACopiesfilelist.txt ] ; then
  29. for file in `cat $CT_TMP/logs/CTRMDATACopiesfilelist.txt`
  30. do
  31. sed -f $CT_HOME/../resources/util/common/bin/rmdata.sed $file > $file.tmp
  32. if [ ${?} -ne 0 ] ; then
  33. rm $file.tmp
  34. rm $file
  35. else
  36. mv $file.tmp $file
  37. fi
  38. done
  39. fi
  40. IFS=$old_IFS # restore default field separator