Microsoft.HPUX.11iv3.Kit.ia64 (DeployableResource)
Element properties:
Source Code:
<DeployableResource ID="Microsoft.HPUX.11iv3.Kit.ia64" Accessibility="Internal" FileName="scx-1.6.2-336.hpux.11iv3.ia64.sh" HasNullStream="false"/>
File Content: scx-1.6.2-336.hpux.11iv3.ia64.sh
#!/bin/sh
#
# Shell Bundle installer package for the SCX project
#
PATH=/usr/bin:/usr/sbin:/bin:/sbin
umask 022
# Can't use something like 'readlink -e $0' because that doesn't work everywhere
# And HP doesn't define $PWD in a sudo environment, so we define our own
case $0 in
/*|~*)
SCRIPT_INDIRECT="`dirname $0`"
;;
*)
PWD="`pwd`"
SCRIPT_INDIRECT="`dirname $PWD/$0`"
;;
esac
SCRIPT_DIR="`(cd \"$SCRIPT_INDIRECT\"; pwd -P)`"
SCRIPT="$SCRIPT_DIR/`basename $0`"
EXTRACT_DIR="`pwd -P`/scxbundle.$$"
# These symbols will get replaced during the bundle creation process.
#
# The OM_PKG symbol should contain something like:
# scx-1.5.1-115.rhel.6.x64 (script adds .rpm or .deb, as appropriate)
# Note that for non-Linux platforms, this symbol should contain full filename.
#
TAR_FILE=scx-1.6.2-336.hpux.11iv3.ia64.depot.tar
OM_PKG=scx-1.6.2-336.hpux.11iv3.ia64.depot
OMI_PKG=omi-1.0.8-6.hpux.11iv3.ia64.depot
SCRIPT_LEN=379
SCRIPT_LEN_PLUS_ONE=380
usage()
{
echo "usage: $1 [OPTIONS]"
echo "Options:"
echo " --extract Extract contents and exit."
echo " --force Force upgrade (override version checks)."
echo " --install Install the package from the system."
echo " --purge Uninstall the package and remove all related data."
echo " --remove Uninstall the package from the system."
echo " --restart-deps Reconfigure and restart dependent service"
echo " --source-references Show source code reference hashes."
echo " --upgrade Upgrade the package in the system."
echo " --version Version of this shell bundle."
echo " --debug use shell debug mode."
echo " -? | --help shows this usage text."
}
source_references()
{
cat <<EOF
superproject: 724078ddaedbeb7ad0c99e349c94f7f18c56b0ce
omi: 2444f60777affca2fc1450ebe5513002aee05c79
opsmgr: 98eaa5d5a8c4232c1d66172bdb8bac721f3b0697
opsmgr-kits: e02f9947f2a6062044bb597c418c84f2690164b4
pal: 7c4c3d8820a292c556597ce74547b16604dfbf2a
EOF
}
cleanup_and_exit()
{
# $1: Exit status
# $2: Non-blank (if we're not to delete bundles), otherwise empty
if [ -z "$2" -a -d "$EXTRACT_DIR" ]; then
cd $EXTRACT_DIR/..
rm -rf $EXTRACT_DIR
fi
if [ -n "$1" ]; then
exit $1
else
exit 0
fi
}
getVersionNumber()
{
# Parse a version number from a string.
#
# Parameter 1: string to parse version number string from
# (should contain something like mumble-4.2.2.135.universal.x86.tar)
# Parameter 2: prefix to remove ("mumble-" in above example)
if [ $# -ne 2 ]; then
echo "INTERNAL ERROR: Incorrect number of parameters passed to getVersionNumber" >&2
cleanup_and_exit 1
fi
echo $1 | sed -e "s/$2//" -e 's/\.hpux\..*//' -e 's/-/./'
}
verifyNoInstallationOption()
{
if [ -n "${installMode}" ]; then
echo "$0: Conflicting qualifiers, exiting" >&2
cleanup_and_exit 1
fi
return;
}
# $1 - The name of the package to check as to whether it's installed
check_if_pkg_is_installed() {
swlist $1 2> /dev/null 1> /dev/null
return $?
}
# $1 - The filename of the package to be installed
# $2 - The package name of the package to be installed
pkg_add() {
pkg_filename=$1
pkg_name=$2
echo "----- Installing package: $pkg_name ($pkg_filename) -----"
/usr/sbin/swinstall -s $PWD/$pkg_filename $pkg_name
}
# $1 - The package name of the package to be uninstalled
# $2 - Optional parameter. Only used when forcibly removing omi on SunOS
pkg_rm() {
echo "----- Removing package: $1 -----"
/usr/sbin/swremove $1 # 1> /dev/null 2> /dev/null
}
# $1 - The filename of the package to be installed
# $2 - The package name of the package to be installed
# $3 - Okay to upgrade the package? (Optional)
pkg_upd() {
pkg_filename=$1
pkg_name=$2
echo "----- Updating package: $pkg_name ($pkg_filename) -----"
[ -n "${forceFlag}" -o "${pkg_name}" = "omi" ] && FORCE="-x allow_downdate=true -x reinstall=true" || FORCE=""
/usr/sbin/swinstall $FORCE -s $PWD/${pkg_filename} $pkg_name
}
#
# Main script follows
#
set +e
while [ $# -ne 0 ]
do
case "$1" in
--extract-script)
# hidden option, not part of usage
# echo " --extract-script FILE extract the script to FILE."
head -${SCRIPT_LEN} "${SCRIPT}" > "$2"
local shouldexit=true
shift 2
;;
--extract-binary)
# hidden option, not part of usage
# echo " --extract-binary FILE extract the binary to FILE."
tail -n +${SCRIPT_LEN_PLUS_ONE} "${SCRIPT}" > "$2"
local shouldexit=true
shift 2
;;
--extract)
verifyNoInstallationOption
installMode=E
shift 1
;;
--force)
forceFlag=true
shift 1
;;
--install)
verifyNoInstallationOption
installMode=I
shift 1
;;
--purge)
verifyNoInstallationOption
installMode=P
shouldexit=true
shift 1
;;
--remove)
verifyNoInstallationOption
installMode=R
shouldexit=true
shift 1
;;
--restart-deps)
restartDependencies=--restart-deps
shift 1
;;
--source-references)
source_references
cleanup_and_exit 0
;;
--upgrade)
verifyNoInstallationOption
installMode=U
shift 1
;;
--version)
echo "Version: `getVersionNumber $OM_PKG scx-`"
exit 0
;;
--debug)
echo "Starting shell debug mode." >&2
echo "" >&2
echo "SCRIPT_INDIRECT: $SCRIPT_INDIRECT" >&2
echo "SCRIPT_DIR: $SCRIPT_DIR" >&2
echo "EXTRACT DIR: $EXTRACT_DIR" >&2
echo "SCRIPT: $SCRIPT" >&2
echo >&2
set -x
shift 1
;;
-? | --help)
usage `basename $0` >&2
cleanup_and_exit 0
;;
*)
usage `basename $0` >&2
cleanup_and_exit 1
;;
esac
done
if [ -z "${installMode}" ]; then
echo "$0: No options specified, specify --help for help" >&2
cleanup_and_exit 3
fi
#
# Note: From this point, we're in a temporary directory. This aids in cleanup
# from bundled packages in our package (we just remove the diretory when done).
#
mkdir -p $EXTRACT_DIR
cd $EXTRACT_DIR
# Create installation administrative file for Solaris platform if needed
# Do we need to remove the package?
if [ "$installMode" = "R" -o "$installMode" = "P" ]
then
if [ -f /opt/microsoft/scx/bin/uninstall ]; then
/opt/microsoft/scx/bin/uninstall $installMode
else
pkg_rm scx
pkg_rm omi
fi
if [ "$installMode" = "P" ]
then
echo "Purging all files in cross-platform agent ..."
rm -rf /etc/opt/microsoft/scx /opt/microsoft/scx /var/opt/microsoft/scx
rmdir /etc/opt/microsoft /opt/microsoft /var/opt/microsoft 1>/dev/null 2>/dev/null
# If OMI is not installed, purge its directories as well.
check_if_pkg_is_installed omi
if [ $? -ne 0 ]; then
rm -rf /etc/opt/omi /opt/omi /var/opt/omi
fi
fi
fi
if [ -n "${shouldexit}" ]
then
# when extracting script/tarball don't also install
cleanup_and_exit 0
fi
#
# Do stuff before extracting the binary here, for example test [ `id -u` -eq 0 ],
# validate space, platform, uninstall a previous version, backup config data, etc...
#
#
# Extract the binary here.
#
echo "Extracting..."
tail -n +${SCRIPT_LEN_PLUS_ONE} "${SCRIPT}" | zcat - | tar xf -
STATUS=$?
if [ ${STATUS} -ne 0 ]
then
echo "Failed: could not extract the install bundle."
cleanup_and_exit ${STATUS}
fi
#
# Do stuff after extracting the binary here, such as actually installing the package.
#
EXIT_STATUS=0
SCX_EXIT_STATUS=0
OMI_EXIT_STATUS=0
case "$installMode" in
E)
# Files are extracted, so just exit
cleanup_and_exit 0 "SAVE"
;;
I)
echo "Installing cross-platform agent ..."
check_if_pkg_is_installed omi
if [ $? -eq 0 ]; then
pkg_upd $OMI_PKG omi
# It is acceptable that this fails due to the new omi being
# the same version (or less) than the one currently installed.
OMI_EXIT_STATUS=0
else
pkg_add $OMI_PKG omi
OMI_EXIT_STATUS=$?
fi
pkg_add $OM_PKG scx
SCX_EXIT_STATUS=$?
;;
U)
echo "Updating cross-platform agent ..."
check_if_pkg_is_installed omi
if [ $? -eq 0 ]; then
pkg_upd $OMI_PKG omi
# It is acceptable that this fails due to the new omi being
# the same version (or less) than the one currently installed.
OMI_EXIT_STATUS=0
else
pkg_add $OMI_PKG omi
OMI_EXIT_STATUS=$?
fi
pkg_upd $OM_PKG scx
SCX_EXIT_STATUS=$?
;;
*)
echo "$0: Invalid setting of variable \$installMode, exiting" >&2
cleanup_and_exit 2
esac
# Remove temporary files (now part of cleanup_and_exit) and exit
if [ "$SCX_EXIT_STATUS" -ne 0 -o "$OMI_EXIT_STATUS" -ne 0 ]; then
cleanup_and_exit 1
else
cleanup_and_exit 0
fi
#####>>- This must be the last line of this script, followed by a single empty line. -<<#####
siÅ
2Z̘q
:x\ĈiؠL8o Iɓ(S\Ki x #F
.cXxc&2l Gwޘ83P @`IիX3N9 @ SF4cʈz2 vʝKݻx+7g^$qBtgΛ>utLS'EH:ci4h95'z㓬YjKʷQ14]SN7n M/v9DA
l)sv:r2\^N2Ę
sH89C2g
w
xGƵQu`C3p
1^_e@Zxavoȑ^[
WuB) G_htPn!DRe
GenцeY@tn"aFPct1hA:|Zr1fo!Ycd1hHv^u]魧@nt!'&nhx7iy(P}z^A%
o9[zppwPz3XfB
J( LGWeY5 pus\{je"C'jȡe
|5p1i-TBHt_lF
0!ґG d
ʥN\1-!ӚW*ˢi+c6bjfA+/$Fxf!'Ytċhģ_^!'fYGQ'"!7i-
cpm:n .r. ]g"%`@_Ai ]Fvi
7*vw~A.1P
5̀k [wwh),p=Bvujx]&ru.,bhs`^@Еa!az@,&MpRt7/2
u)ALH¹+lRِ6JKSڐ pC09ttpteAb:GU2} 1D !
>{2W
=kEҖGԆ!HIZR$ IJV0$'Iɒ/)@#<y`c*X43Q8z&2ǃi@I%[lB40yV
\ۤf#f)
*#!90;f2=6 Rgfh9̍rL:~ v0 D7P<,e'3C'm(T
ke
_Ņqe ҖLfԦ`Nvt?n[JԢHjtJTة\
=]2څ3wZh䩧:W=Mz(
F,aX!m[Zut]SV䕤3zҦ=5*SbK:&a#sCN6!g6d(fLNa&3
GDC[O#MYiVYs8(:Jٶ>
n丕m]U8nM[DZ!r}\W-\ %hPnRd$@GSJRF2ETaIw6,bh83Λ r<6"̛
Y1| N=f>[XcP%X~h!S9J
K2[@\4]~K9$ MgD0UOmb쨺%VŭMxɣWuV`uX^"%W%}[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