summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorDavid Kaufmann <astra@ionic.at>2017-04-26 01:17:30 +0200
committerDavid Kaufmann <astra@ionic.at>2017-04-26 01:17:30 +0200
commite1b999bf49f71d1c78ad8f53f0f9291cafd7e142 (patch)
treee82e239d94b5dfe8a8bc58d782ade6c0206e5258 /home
parenta4bde9ae3273eceb125d2916baa78fd6714aa75a (diff)
downloadconfig-e1b999bf49f71d1c78ad8f53f0f9291cafd7e142.tar.gz
remove wget, add curl
Diffstat (limited to 'home')
-rwxr-xr-xhome/bin/config-update.sh24
1 files changed, 14 insertions, 10 deletions
diff --git a/home/bin/config-update.sh b/home/bin/config-update.sh
index a0dc1bb..1c644a0 100755
--- a/home/bin/config-update.sh
+++ b/home/bin/config-update.sh
@@ -7,19 +7,23 @@ cd ${HOME}
# fetch file from server
TMP=`mktemp -u --suffix=".tar.gz" "config-updater-XXXXXX"`
-curl -s "${URL}${FILE}" > $TMP
+curl -s "${URL}${FILE}" -o $TMP
-# check if file is empty
-if [ -s $TMP ]; then
- if [ -r ${HOME}/var/system/config-updater/pre-update ]; then
- source ${HOME}/var/system/config-updater/pre-update
- fi
- tar -xzf $TMP --strip-components=1
- if [ -r ${HOME}/var/system/config-updater/pre-update ]; then
- source ${HOME}/var/system/config-updater/pre-update
+# check if file exists and is not empty
+if [ -e $TMP ]; then
+ if [ -s $TMP ]; then
+ if [ -r ${HOME}/var/system/config-updater/pre-update ]; then
+ source ${HOME}/var/system/config-updater/pre-update
+ fi
+ tar -xzf $TMP --strip-components=1
+ if [ -r ${HOME}/var/system/config-updater/pre-update ]; then
+ source ${HOME}/var/system/config-updater/pre-update
+ fi
+ else
+ echo "Could not fetch updated config, $TMP is empty"
fi
else
- echo "Could not fetch updated config, $TMP is empty"
+ echo "Could not fetch updated config, $TMP is missing"
fi
rm -f $TMP