aio-builder/sample/4.0.2/opsi-template-with-admin/OPSI/postinst

27 lines
797 B
Plaintext
Raw Normal View History

2013-03-07 22:43:46 +01:00
#! /bin/bash
#
# This script executes after unpacking files from that archive and registering the product at the server.
#
# The following environment variables can be used to obtain information about the current installation:
# PRODUCT_ID: id of the current product
# CLIENT_DATA_DIR: directory which contains the installed client data
#
TMP_DIR=${CLIENT_DATA_DIR}/../${PRODUCT_ID}.tmp
echo 'Restoring previous files...'
if [ -f $TMP_DIR/psgetsid.exe ]; then
mv $TMP_DIR/psgetsid.exe $CLIENT_DATA_DIR/ || exit 1
fi
echo 'get files if not present'
if [ ! -f "$CLIENT_DATA_DIR/psgetsid.exe" ]; then
cd $CLIENT_DATA_DIR
echo 'try to get zip'
wget http://download.sysinternals.com/Files/PsTools.zip
echo 'unzip'
unzip -o PsTools.zip
fi
echo "Removing temporary files..."
rm -rf $TMP_DIR