#!/bin/bash SUBUPCNF="/etc/subUp.cnf" OLD_DIR="$(pwd)" die(){ echo "$@" && exit 1 } [ -f $SUBUPCNF ] || die "The Configuration File is missing...please chek your settings $SUBUPCNF" source $SUBUPCNF cd "$POOL_HOME_DIRECTORY" mkdir -p "$POOL_HOME_DIRECTORY/$POOL_NAME" cp $@ $POOL_HOME_DIRECTORY/$POOL_NAME cd $POOL_NAME dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz chown www-data:www-data -R * cd "$OLD_DIR"