From 299e8aceeb1691819fd10f2e6b2d643f52dbfadf Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 7 Apr 2017 11:37:30 -0700 Subject: [PATCH] Check if --data-dir exists --- scripts/cloudron-setup | 5 +++++ scripts/installer.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/cloudron-setup b/scripts/cloudron-setup index 77fc0fbf3..68792606b 100755 --- a/scripts/cloudron-setup +++ b/scripts/cloudron-setup @@ -126,6 +126,11 @@ if [[ -z "${dataJson}" ]]; then echo "--dns-provider must be one of : manual, noop" exit 1 fi + + if [[ -n "${baseDataDir}" && ! -d "${baseDataDir}" ]]; then + echo "${baseDataDir} does not exist" + exit 1 + fi fi echo "" diff --git a/scripts/installer.sh b/scripts/installer.sh index e2f173275..acc01b9ce 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -60,7 +60,7 @@ if [[ "${is_update}" == "yes" ]]; then fi # setup links to data directory -if [[ "${arg_data_dir}" != "" ]]; then +if [[ -n "${arg_data_dir}" ]]; then echo "==> installer: setting up links to data directory" mkdir "${arg_data_dir}/appsdata" ln -s "${arg_data_dir}/appsdata" "${BASE_DATA_DIR}/appsdata"