From 69963e62ba57896b8c5a1609d494945f9bcfa810 Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Mon, 14 Oct 2024 10:56:58 +0300 Subject: [PATCH] Adding basic envvar checking --- apsalar/icloudsync | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apsalar/icloudsync b/apsalar/icloudsync index a5a27fc..a5a4b65 100755 --- a/apsalar/icloudsync +++ b/apsalar/icloudsync @@ -9,6 +9,17 @@ if ! type icloudpd >/dev/null; then exit 1 fi +# Ensure environment variables are set +if [[ -z "$ICLOUD_DIR" ]]; then + echo 'please set $ICLOUD_DIR' + exit 1 +fi + +if [[ -z "$ICLOUD_USERNAME" ]]; then + echo 'please set $ICLOUD_USERNAME' + exit 1 +fi + # tmux session name session="icloudsync"