diff options
-rwxr-xr-x | test/test.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/test.sh b/test/test.sh index 78aa164..665f8e9 100755 --- a/test/test.sh +++ b/test/test.sh @@ -132,12 +132,14 @@ cleanup() { echo Cleaning up echo ------------------------------------------------------------------ - local name - find "$base_dir/devices" -mindepth 1 -maxdepth 1 -type d -printf '%P\0' \ - | while IFS= read -d '' -r name; do - echo "Removing interface: $name" - ip link delete "$name" type wireguard || true - done + if [ -d "$base_dir/devices" ]; then + local name + find "$base_dir/devices" -mindepth 1 -maxdepth 1 -type d -printf '%P\0' \ + | while IFS= read -d '' -r name; do + echo "Removing interface: $name" + ip link delete "$name" type wireguard || true + done + fi echo "Removing $base_dir" rm -rf -- "$base_dir" |