From 809b78f7fc06f50a4d807874ecdd24f8d43c3ab3 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Wed, 26 Apr 2017 01:27:52 +0200 Subject: make more sh friendly --- home/bin/config-update.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'home') 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" -- cgit v1.2.3