diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-07-11 14:05:23 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-07-11 14:05:23 +0000 |
commit | 1a77908732a9df0e8cbb796e1b7f664a97d83194 (patch) | |
tree | 71ae0069c656966b72579944f9ef278706a50e9b /setup_native/scripts | |
parent | 6569b8a2f0ca8420bdd66303ee17e1e949c9922c (diff) |
INTEGRATION: CWS stclient (1.1.2); FILE ADDED
2007/06/25 09:29:20 obr 1.1.2.1: #6573281# wrapper script for running stclient on Solaris
Diffstat (limited to 'setup_native/scripts')
-rw-r--r-- | setup_native/scripts/stclient_wrapper.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/setup_native/scripts/stclient_wrapper.sh b/setup_native/scripts/stclient_wrapper.sh new file mode 100644 index 000000000000..e934e44ce2ef --- /dev/null +++ b/setup_native/scripts/stclient_wrapper.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Copyright (c) 2007 by Sun Microsystems, Inc. +# All rights reserved. +# + +STCLIENT=/usr/bin/stclient + +TARGET_URN= +PRODUCT_NAME= +PRODUCT_VERSION= +PRODUCT_SOURCE= +PARENT_PRODUCT_NAME= + +while [ $# -gt 0 ] +do + case "$1" in + -t) TARGET_URN="$2"; shift;; + -p) PRODUCT_NAME="$2"; shift;; + -e) PRODUCT_VERSION="$2"; shift;; + -P) PARENT_PRODUCT_NAME="$2"; shift;; + -S) PRODUCT_SOURCE="$2"; shift;; + --) shift; break;; + -*) + echo >&2 \ + "usage: $0 -p <product name> -e <product version> -t <urn> -S <source> -P <parent product name>" + exit 1;; + *) break;; + esac + shift +done + +if [ -x "$STCLIENT" ]; then + INSERT="false" + + TEST=`${STCLIENT} -f -t ${TARGET_URN}` + + if [ "${TEST}" = "No records found" ]; then + INSERT="true" + fi + + if [ "${INSERT}" = "true" ]; then + if [ `uname -s` = "SunOS" ]; then + uname=`uname -p` + zone="global" + if [ -x /usr/bin/zonename ]; then + zone=`/usr/bin/zonename` + fi + + output=`${STCLIENT} -a -p "${PRODUCT_NAME}" -e "${PRODUCT_VERSION}" -t "${TARGET_URN}" -S "${PRODUCT_SOURCE}" -P "${PARENT_PRODUCT_NAME}" -m "Sun Microsystems, Inc." -A ${uname} -z global` + fi + fi +fi + +exit 0 |