correct client copy

This commit is contained in:
Mario Fetka 2014-03-14 13:19:06 +01:00
parent 0e46e826c5
commit 6bdc6a0801
2 changed files with 1 additions and 19 deletions

View File

@ -8,20 +8,12 @@
TMP_DIR=${CLIENT_DATA_DIR}/../${PRODUCT_ID}.tmp
major=`cat /etc/opsi/version | cut -d'.' -f1`
minor=`cat /etc/opsi/version | cut -d'.' -f2`
if [ ! $major -ge 4 ]; then
if [ $major -le 2 -o $minor -le 98 ]; then
echo "This product requires opsi version >= 3.99" 1>&2
exit 1
fi
fi
if [ -d $TMP_DIR ]; then
echo 'Restoring previous directories...'
for dirname in client; do
for path in $TMP_DIR/$dirname; do
if [ -d $path ]; then
test -e $TMP_DIR/`basename $path` && cp -ar $CLIENT_DATA_DIR/`basename $path`/* $TMP_DIR/`basename $path`
test -e $CLIENT_DATA_DIR/`basename $path` && rm -rf $CLIENT_DATA_DIR/`basename $path`
echo " moving $path to $CLIENT_DATA_DIR"
mv $path $CLIENT_DATA_DIR/ || exit 1
@ -33,7 +25,6 @@ fi
echo "Removing temporary files..."
rm -rf $TMP_DIR
chmod u+x,g+x $CLIENT_DATA_DIR/*.py

View File

@ -8,15 +8,6 @@
TMP_DIR=${CLIENT_DATA_DIR}/../${PRODUCT_ID}.tmp
major=`cat /etc/opsi/version | cut -d'.' -f1`
minor=`cat /etc/opsi/version | cut -d'.' -f2`
if [ ! $major -ge 4 ]; then
if [ $major -le 2 -o $minor -le 98 ]; then
echo "This product requires opsi version >= 3.99" 1>&2
exit 1
fi
fi
if [ -d $TMP_DIR ]; then
echo "Temporary directory $TMP_DIR already exist, aborting!" 1>&2
exit 1