From c79d46b868a1a4a7d1800a02e00e7698e9835424 Mon Sep 17 00:00:00 2001 From: szaimen Date: Sat, 26 Mar 2022 19:38:17 +0100 Subject: [PATCH] ad a test to rsync script Signed-off-by: szaimen --- readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/readme.md b/readme.md index eda201e4..19fcf2c1 100644 --- a/readme.md +++ b/readme.md @@ -209,6 +209,11 @@ if ! [ -d "$SOURCE_DIRECTORY" ]; then exit 1 fi +if [ -z "$(ls -A "$SOURCE_DIRECTORY/")" ]; then + echo "The source directory is empty which is not allowed." + exit 1 +fi + if ! [ -d "$DRIVE_MOUNTPOINT" ]; then echo "The drive mountpoint must be an existing directory" exit 1