|
8 | 8 | # url: https://github.com/christianbaun/ossperf |
9 | 9 | # license: GPLv3 |
10 | 10 | # date: October 8th 2019 |
11 | | -# version: 3.8 |
| 11 | +# version: 1.0 |
12 | 12 | # bash_version: 4.4.12(1)-release |
13 | 13 | # requires: md5sum (tested with version 8.26), |
14 | 14 | # bc (tested with version 1.06.95), |
@@ -469,22 +469,26 @@ else |
469 | 469 | fi |
470 | 470 | fi |
471 | 471 |
|
472 | | - |
473 | | - |
474 | 472 | # Check if the directory already exists |
475 | 473 | # This is not a part of the benchmark! |
476 | 474 | if [ -e ${DIRECTORY} ] ; then |
477 | 475 | # Terminate the script, in case the directory already exists |
478 | | - echo -e "${RED}[ERROR] The directory ${DIRECTORY} already exists in the local directory!${NC}" && exit 1 |
479 | | -else |
480 | | - if mkdir ${DIRECTORY} ; then |
481 | | - # Create the directory if it does not already exist |
482 | | - echo -e "${GREEN}[OK] The directory ${DIRECTORY} has been created in the local directory.${NC}" |
| 476 | + echo -e "${YELLOW}[INFO] The directory ${DIRECTORY} already exists in the local directory.${NC}" |
| 477 | + if rm -rf ${DIRECTORY} ; then |
| 478 | + echo -e "${GREEN}[OK] The old local directory ${DIRECTORY} has been erased.${NC}" |
483 | 479 | else |
484 | | - echo -e "${RED}[ERROR] Unable to create the directory ${DIRECTORY} in the local directory.${NC}" && exit 1 |
| 480 | + echo -e "${RED}[ERROR] Unable to erase the local directory ${DIRECTORY}.${NC}" && exit 1 |
485 | 481 | fi |
486 | 482 | fi |
487 | 483 |
|
| 484 | +# Create the directory |
| 485 | +# This is not a part of the benchmark! |
| 486 | +if mkdir ${DIRECTORY} ; then |
| 487 | + echo -e "${GREEN}[OK] The local directory ${DIRECTORY} has been created.${NC}" |
| 488 | +else |
| 489 | + echo -e "${RED}[ERROR] Unable to create the local directory ${DIRECTORY}.${NC}" && exit 1 |
| 490 | +fi |
| 491 | + |
488 | 492 | # Create files with random content of given size |
489 | 493 | # This is not a part of the benchmark! |
490 | 494 | for ((i=1; i<=${NUM_FILES}; i+=1)) |
|
0 commit comments