mirror of
https://github.com/tomasriveral/vps-config.git
synced 2026-10-02 18:14:28 +02:00
fix icloud auth script
This commit is contained in:
1 parent
f2e3f30173
commit
07d1404be9
1 file changed
+10
-4
+10
-4
@@ -12,15 +12,21 @@ if [[ ! -f "$ENV_FILE" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC1090
|
||||
source "$ENV_FILE"
|
||||
get_env_value() {
|
||||
local key="$1"
|
||||
|
||||
if [[ -z "${ICLOUD_EMAIL:-}" ]]; then
|
||||
sed -n "s/^${key}=//p" "$ENV_FILE" | head -n 1
|
||||
}
|
||||
|
||||
ICLOUD_EMAIL="$(get_env_value ICLOUD_EMAIL)"
|
||||
ICLOUD_PASSWORD="$(get_env_value ICLOUD_PASSWORD)"
|
||||
|
||||
if [[ -z "$ICLOUD_EMAIL" ]]; then
|
||||
echo "ERROR: ICLOUD_EMAIL is not configured."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "${ICLOUD_PASSWORD:-}" ]]; then
|
||||
if [[ -z "$ICLOUD_PASSWORD" ]]; then
|
||||
echo "ERROR: ICLOUD_PASSWORD is not configured."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user