diff options
| -rwxr-xr-x | home/bin/config-update.sh | 9 |
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" |
