#!/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 -L -s "${URL}${FILE}" -o $TMP # check if file exists and is not empty if [ -e $TMP ]; then 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 else echo "Could not fetch updated config, $TMP is missing" fi rm -f $TMP