diff options
Diffstat (limited to 'home/bin/config-update.sh')
| -rwxr-xr-x | home/bin/config-update.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/home/bin/config-update.sh b/home/bin/config-update.sh new file mode 100755 index 0000000..a0dc1bb --- /dev/null +++ b/home/bin/config-update.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +URL="http://pluto.fsinf.at/~astra/config/" +FILE="skel.tar.gz" + +cd ${HOME} + +# fetch file from server +TMP=`mktemp -u --suffix=".tar.gz" "config-updater-XXXXXX"` +curl -s "${URL}${FILE}" > $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 + fi +else + echo "Could not fetch updated config, $TMP is empty" +fi + +rm -f $TMP |
