#!/bin/sh # define common locations and temp dirs WEBCON_DIR=${ROOTDIR}/usr/share/webconsole BIN_DIR=/usr/share/webconsole/bin PRIV_BIN_DIR=${ROOTDIR}/usr/share/webconsole/private/bin ETC_DIR=${ROOTDIR}/etc/webconsole/console TMP_DIR=${ETC_DIR}/.patch_tmp RESTART_FLAG=${TMP_DIR}/restart DEFAULT_DOMAIN_NAME=console BUN_FILE=/var/svc/manifest/system/webconsole.xml # Clean up from a potential previous failure rm -rf ${TMP_DIR} # Create the new temp directory mkdir ${TMP_DIR} # Only execute commands if patching live system. if [ "${ROOTDIR}" = "" -o "${ROOTDIR}" = "/" ]; then # determine console status, stop if necessary, # set flag for restart after the patch is applied if [ -x ${BIN_DIR}/smcwebserver ];then console_status=`${BIN_DIR}/smcwebserver status -p | awk -F= '{print $2}'` if [ "${console_status}" = "yes" ];then ${BIN_DIR}/smcwebserver stop touch ${RESTART_FLAG} fi fi # wcremove console domain ${PRIV_BIN_DIR}/wcremove -i ${DEFAULT_DOMAIN_NAME} # For s10 and up wcremove will place the console in # maintenance mode, so clear before restart # SMF service bundle file must be installed for S10 up. # It will not be installed in the package otherwise. if [ -f ${BUN_FILE} ]; then /usr/sbin/svcadm clear svc:system/webconsole:console fi fi # save current configuration cp ${ETC_DIR}/config.properties ${TMP_DIR} if [ $? -ne 0 ];then echo "Could not cache current configuration." exit 1 fi exit 0