diff --git a/CLIENT_DATA/client/empty b/CLIENT_DATA/client/empty deleted file mode 100644 index e69de29..0000000 diff --git a/OPSI/postinst b/OPSI/postinst index a8e33fc..fd7a878 100644 --- a/OPSI/postinst +++ b/OPSI/postinst @@ -1,9 +1,54 @@ -#! /bin/sh +#!/bin/bash # -# postinst script for softprod +# postinst script # 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 -# +# PRODUCT_ID, PRODUCT_TYPE, PRODUCT_VERSION, PACKAGE_VERSION, CLIENT_DATA_DIR, DEPOT_ID + +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 $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 + fi + done + done +fi + +echo "Removing temporary files..." +rm -rf $TMP_DIR + +chmod u+x,g+x $CLIENT_DATA_DIR/*.py + + + + + + + + + + + + + + + + + + diff --git a/OPSI/preinst b/OPSI/preinst index 15a5320..f2fa0e5 100644 --- a/OPSI/preinst +++ b/OPSI/preinst @@ -1,9 +1,41 @@ -#! /bin/sh +#!/bin/bash # -# preinst script for softprod +# preinst script # 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 -# +# PRODUCT_ID, PRODUCT_TYPE, PRODUCT_VERSION, PACKAGE_VERSION, CLIENT_DATA_DIR, DEPOT_ID + +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 +fi + +[ ! -d $CLIENT_DATA_DIR ] && mkdir $CLIENT_DATA_DIR +mkdir $TMP_DIR + +if [ -d $CLIENT_DATA_DIR ]; then + echo "Saving previous directories..." + for dirname in client; do + for path in $CLIENT_DATA_DIR/$dirname; do + if [ -e $path ]; then + echo " moving $path to $TMP_DIR" + mv $path $TMP_DIR/ || exit 1 + fi + done + done +fi + +exit 0 + diff --git a/builder-product.cfg b/builder-product.cfg index a6bbc94..7f84e81 100644 --- a/builder-product.cfg +++ b/builder-product.cfg @@ -5,7 +5,7 @@ VENDOR="wsusoffline.net" PN="microsoft.wsusoffline" NAME="WSUS Offline Update" DESCRIPTION="Update Microsoft Windows and Office without an Internet connection" -VERSION="20140107" +VERSION="9.0" RELEASE="3" PRIORITY="0" ADVICE="" @@ -17,6 +17,13 @@ TYPE="public" DL_FILE[0]="wsus.jpg" DL_SOURCE[0]="http://ostermeier.net/wp-content/uploads/2013/06/wsus.jpg" +DL_FILE[1]="wsusoffline${VERSION//./}.zip" +DL_SOURCE[1]="http://download.wsusoffline.net/wsusoffline${VERSION//./}.zip" +DL_ARCH[1]="ALL" +DL_DOWNLOADER[1]="wget" +DL_EXTRACT_FORMAT[1]="unzip" + + # File array index for the image showing while installing the program ICON_DL_INDEX=0 diff --git a/builder-targets-cb.sh b/builder-targets-cb.sh index 9a3d4a8..175086a 100644 --- a/builder-targets-cb.sh +++ b/builder-targets-cb.sh @@ -23,3 +23,11 @@ function cleanup() { echo "Cleanup" builder_cleanup } + +function create() { + echo "Create" + builder_create + + rsync -avr $INST_DIR/CLIENT_DATA/ALL/wsusoffline/* $INST_DIR/CLIENT_DATA + rm -rf $INST_DIR/CLIENT_DATA/ALL +} \ No newline at end of file diff --git a/wsusoffline90.zip.sha1sum b/wsusoffline90.zip.sha1sum new file mode 100644 index 0000000..e5ee578 --- /dev/null +++ b/wsusoffline90.zip.sha1sum @@ -0,0 +1 @@ +76baecf2e61ff7dcd977db190d1e45e4f834cc36 /home/mario/.opsi-dist-cache/microsoft.wsusoffline-9.0//wsusoffline90.zip