From e1b999bf49f71d1c78ad8f53f0f9291cafd7e142 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Wed, 26 Apr 2017 01:17:30 +0200 Subject: remove wget, add curl --- home/bin/config-update.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'home') 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 -- cgit v1.2.3