summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorDavid Kaufmann <astra@ionic.at>2017-04-26 01:27:52 +0200
committerDavid Kaufmann <astra@ionic.at>2017-04-26 01:27:52 +0200
commit809b78f7fc06f50a4d807874ecdd24f8d43c3ab3 (patch)
tree6bc9ba7e40d16a874d3004495a829d8fbc11c879 /home
parentcbea3b6f64ec81f3eeeb43b747a513a8be2eeb44 (diff)
downloadconfig-809b78f7fc06f50a4d807874ecdd24f8d43c3ab3.tar.gz
make more sh friendly
Diffstat (limited to 'home')
-rwxr-xr-xhome/bin/config-update.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/home/bin/config-update.sh b/home/bin/config-update.sh
index 76880dc..8508842 100755
--- a/home/bin/config-update.sh
+++ b/home/bin/config-update.sh
@@ -12,12 +12,17 @@ curl -L -s "${URL}${FILE}" -o $TMP
# check if file exists and is not empty
if [ -e $TMP ]; then
if [ -s $TMP ]; then
+ # run pre-update commands if file exists
if [ -r ${HOME}/var/system/config-updater/pre-update ]; then
- source ${HOME}/var/system/config-updater/pre-update
+ . ${HOME}/var/system/config-updater/pre-update
fi
+
+ # unpack new structure
tar -xzf $TMP --strip-components=1
+
+ # run post-update commands if file exists
if [ -r ${HOME}/var/system/config-updater/pre-update ]; then
- source ${HOME}/var/system/config-updater/pre-update
+ . ${HOME}/var/system/config-updater/pre-update
fi
else
echo "Could not fetch updated config, $TMP is empty"