diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-01-08 18:17:29 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-01-08 18:17:29 +0100 |
commit | 4119f6ebcabfb4285fb2456f10461cee57c6560a (patch) | |
tree | 72236e23202363232ef3ea5175210613684f2e40 /scripts/sdks/agl/db-update | |
parent | 25df9a0cd445ed4e0c958a2ca0227f4f1465a5e0 (diff) |
Fixed sdks db-update name and backup prev version.v1.0.0
Diffstat (limited to 'scripts/sdks/agl/db-update')
-rwxr-xr-x | scripts/sdks/agl/db-update | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/sdks/agl/db-update b/scripts/sdks/agl/db-update index a222db9..4f8d933 100755 --- a/scripts/sdks/agl/db-update +++ b/scripts/sdks/agl/db-update @@ -1,6 +1,6 @@ #!/bin/bash ########################################################################### -# Copyright 2017 IoT.bzh +# Copyright 2017-2018 IoT.bzh # # author: Sebastien Douheret <sebastien@iot.bzh> # @@ -19,4 +19,10 @@ . $(dirname "$0")/_env-init.sh -wget -q --connect-timeout=30 ${SDK_DATABASE} -O $1 +sdksDBFile=${1} + +[ "${sdksDBFile}" = "" ] && sdksDBFile=${SDK_ROOT_DIR}/sdks_latest.json + +[ -f "${sdksDBFile}" ] && mv "${sdksDBFile}" "${sdksDBFile}.old" + +wget -q --connect-timeout=30 "${SDK_DATABASE}" -O "${sdksDBFile}" |