#!/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