Index: scripts/decommission.sh =================================================================== diff -u -ra79353ff48472c51647862dfd322d7a2cefabcaf -r984f3ebe19ddb9cf4bdfd9b2d47c082ff0b3426b --- scripts/decommission.sh (.../decommission.sh) (revision a79353ff48472c51647862dfd322d7a2cefabcaf) +++ scripts/decommission.sh (.../decommission.sh) (revision 984f3ebe19ddb9cf4bdfd9b2d47c082ff0b3426b) @@ -41,6 +41,7 @@ LOC_SETTINGS_CONF="/var/configurations/Settings/System.conf" LOC_SETTINGS_DFLT="/var/configurations/Settings/System.dflt" LOC_LOG_BASE_FOLDER="/media/sd-card/" +LOC_TX_LOG_BASE_FOLDER="/var/configurations/treatment/" LOC_COUDSYNC_TOKENS="/var/configurations/CloudSync/" TRUE=1 @@ -178,14 +179,23 @@ # - are not deleted # - not part of the checking whether deletion was successful # - setting maxDepth to 2 due to path used is root level with sd-card/ folders of logs - find "$LOC_LOG_BASE_FOLDER" -maxdepth 2 -type f -daystart -mtime +0 -exec rm -f {} + - - _has_error_=$? + find "$LOC_LOG_BASE_FOLDER" -maxdepth 2 -type f -daystart -mtime +0 | xargs rm + _has_error_=!$? exitError $_has_error_ $ERR_REMOVE_CMD_FIL "Log file deletion" fileCount=$(find "$LOC_LOG_BASE_FOLDER" -maxdepth 2 -type f -daystart -mtime +0 | wc -l) _has_error_=$fileCount exitError $_has_error_ $ERR_REMOVE_DEL_FIL "Remained '$fileCount' file undeleted" + + # Deleting treatment logs in encrypted partition: + find "$LOC_TX_LOG_BASE_FOLDER" -maxdepth 2 -type f | xargs rm + + _has_error_=!$? + exitError $_has_error_ $ERR_REMOVE_CMD_FIL "Tx Log file deletion" + + fileCount=$(find "$LOC_TX_LOG_BASE_FOLDER" -maxdepth 2 -type f | wc -l) + _has_error_=$fileCount + exitError $_has_error_ $ERR_REMOVE_DEL_FIL "Remained '$fileCount' file undeleted" } function deletePartitionPassword() { Index: scripts/factory_reset.sh =================================================================== diff -u -ra79353ff48472c51647862dfd322d7a2cefabcaf -r984f3ebe19ddb9cf4bdfd9b2d47c082ff0b3426b --- scripts/factory_reset.sh (.../factory_reset.sh) (revision a79353ff48472c51647862dfd322d7a2cefabcaf) +++ scripts/factory_reset.sh (.../factory_reset.sh) (revision 984f3ebe19ddb9cf4bdfd9b2d47c082ff0b3426b) @@ -40,6 +40,7 @@ LOC_SETTINGS_CONF="/var/configurations/Settings/System.conf" LOC_SETTINGS_DFLT="/var/configurations/Settings/System.dflt" LOC_LOG_BASE_FOLDER="/media/sd-card/" +LOC_TX_LOG_BASE_FOLDER="/var/configurations/treatment/" TRUE=1 FALSE=0 @@ -184,14 +185,24 @@ # - are not deleted # - not part of the checking whether deletion was successful # - setting maxDepth to 2 due to path used is root level with sd-card/ folders of logs - find "$LOC_LOG_BASE_FOLDER" -maxdepth 2 -type f -daystart -mtime +0 -exec rm -f {} + - - _has_error_=$? + # NOTE: find command always return true / non-zero! when using with exec + find "$LOC_LOG_BASE_FOLDER" -maxdepth 2 -type f -daystart -mtime +0 | xargs rm + _has_error_=!$? exitError $_has_error_ $ERR_REMOVE_CMD_FIL "Log file deletion" fileCount=$(find "$LOC_LOG_BASE_FOLDER" -maxdepth 2 -type f -daystart -mtime +0 | wc -l) _has_error_=$fileCount exitError $_has_error_ $ERR_REMOVE_DEL_FIL "Remained '$fileCount' file undeleted" + + # Deleting treatment logs in encrypted partition: + find "$LOC_TX_LOG_BASE_FOLDER" -maxdepth 2 -type f | xargs rm + + _has_error_=!$? + exitError $_has_error_ $ERR_REMOVE_CMD_FIL "Tx Log file deletion" + + fileCount=$(find "$LOC_TX_LOG_BASE_FOLDER" -maxdepth 2 -type f | wc -l) + _has_error_=$fileCount + exitError $_has_error_ $ERR_REMOVE_DEL_FIL "Remained '$fileCount' file undeleted" } # delete WiFi settings