summaryrefslogtreecommitdiffstats
path: root/scripts/sdks/agl/db-update
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/sdks/agl/db-update')
-rwxr-xr-xscripts/sdks/agl/db-update6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/sdks/agl/db-update b/scripts/sdks/agl/db-update
index 4f8d933..68bd26a 100755
--- a/scripts/sdks/agl/db-update
+++ b/scripts/sdks/agl/db-update
@@ -23,6 +23,12 @@ sdksDBFile=${1}
[ "${sdksDBFile}" = "" ] && sdksDBFile=${SDK_ROOT_DIR}/sdks_latest.json
+# Backup previous file
[ -f "${sdksDBFile}" ] && mv "${sdksDBFile}" "${sdksDBFile}.old"
+# Create destination directory when needed
+instDir=$(dirname "${sdksDBFile}")
+[ ! -d "${instDir}" ] && mkdir -p "${instDir}"
+
+# Get database
wget -q --connect-timeout=30 "${SDK_DATABASE}" -O "${sdksDBFile}"