Skip to content

Commit 357f7de

Browse files
committed
Merge pull request #203 from ndokos/wip-label-clear-tools
pbench-clear-tools: fix label removal.
2 parents 251f346 + af75399 commit 357f7de

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

agent/util-scripts/pbench-clear-tools

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ tool_group_dir="tools-$group"
6060
if [ -d "$tool_group_dir" ]; then
6161
for this_tool_file in `/bin/ls $tool_group_dir`; do
6262
if [ "$this_tool_file" == "label" ]; then
63-
echo "removing tool label: `cat $tool_group_dir/$this_tool_file`"
64-
/bin/rm -f "$tool_group_dir/$this_tool_file"
6563
continue;
6664
fi
6765
remote=""
@@ -90,5 +88,11 @@ if [ -d "$tool_group_dir" ]; then
9088
fi
9189
fi
9290
done
91+
tool_files=`/bin/ls $tool_group_dir`
92+
# if the only file remaining is the label, remove it
93+
if [ "$tool_files" == "label" ]; then
94+
echo "removing tool label: `cat $tool_group_dir/$tool_files`"
95+
/bin/rm -f "$tool_group_dir/$tool_files"
96+
fi
9397
fi
9498
popd >/dev/null

0 commit comments

Comments
 (0)