diff options
| author | David Kaufmann <astra@ionic.at> | 2017-10-27 17:28:21 +0200 |
|---|---|---|
| committer | David Kaufmann <astra@ionic.at> | 2017-10-27 17:28:21 +0200 |
| commit | bd06f653eb25d101f86260f19522caaeebbc718c (patch) | |
| tree | 1a79a7c99d63bd706c82fbd8ce8dcfaa4e7fc30e /bin | |
| parent | 1fec0a34cd8f2e9f109a11bf62e51bf1e96da74e (diff) | |
| download | config-bd06f653eb25d101f86260f19522caaeebbc718c.tar.gz | |
update for BSD
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/load.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/load.sh b/bin/load.sh index 6dc7deb..82e8420 100755 --- a/bin/load.sh +++ b/bin/load.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh URL="http://pluto.fsinf.at/~astra/config/" FILE="skel.tar.gz" @@ -6,29 +6,29 @@ FILE="skel.tar.gz" cd ${HOME} # fetch file from server -TMP=`mktemp -u --suffix=".tar.gz" "config-updater-XXXXXX"` -curl -L -s "${URL}${FILE}" -o $TMP +TMP=`mktemp -u "config-updater-XXXXXX"` +curl -L -s "${URL}${FILE}" -o $TMP.tar.gz # check if file exists and is not empty -if [ -e $TMP ]; then - if [ -s $TMP ]; then +if [ -e $TMP.tar.gz ]; then + if [ -s $TMP.tar.gz ]; then # run pre-update commands if file exists if [ -r ${HOME}/var/system/config-updater/pre-update ]; then . ${HOME}/var/system/config-updater/pre-update fi # unpack new structure - tar -xzf $TMP --strip-components=1 + tar -xzf $TMP.tar.gz --strip-components=1 # run post-update commands if file exists if [ -r ${HOME}/var/system/config-updater/post-update ]; then . ${HOME}/var/system/config-updater/post-update fi else - echo "Could not fetch updated config, $TMP is empty" + echo "Could not fetch updated config, $TMP.tar.gz is empty" fi else - echo "Could not fetch updated config, $TMP is missing" + echo "Could not fetch updated config, $TMP.tar.gz is missing" fi -rm -f $TMP +rm -f $TMP.tar.gz |
