add new samples and rename OPSI_INI_NAME to OPSI_INI_OPTION (ini typical naming)
This commit is contained in:
28
sample/source/4.0.2/opsi-template-with-admin/OPSI/preinst
Normal file
28
sample/source/4.0.2/opsi-template-with-admin/OPSI/preinst
Normal file
@@ -0,0 +1,28 @@
|
||||
#! /bin/bash
|
||||
#
|
||||
# preinst script for softprod
|
||||
# This script executes before that package will be unpacked from its archive file.
|
||||
#
|
||||
# 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 where client data will be installed
|
||||
#
|
||||
TMP_DIR=${CLIENT_DATA_DIR}/../${PRODUCT_ID}.tmp
|
||||
|
||||
if [ -d $TMP_DIR ]; then
|
||||
echo "Temporary directory $TMP_DIR already exist, aborting!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ ! -d $CLIENT_DATA_DIR ] && mkdir $CLIENT_DATA_DIR
|
||||
mkdir $TMP_DIR
|
||||
|
||||
if [ -d $CLIENT_DATA_DIR ]; then
|
||||
echo "Saving previous files..."
|
||||
if [ -f $CLIENT_DATA_DIR/[pP][sS][gG][eE][tT][sS][iI][dD].[eE][xX][eE] ]; then
|
||||
mv $CLIENT_DATA_DIR/[pP][sS][gG][eE][tT][sS][iI][dD].[eE][xX][eE] $TMP_DIR/psgetsid.exe || exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user