#!/bin/sh # define common locations and temp dirs BIN_DIR=/usr/share/webconsole/bin ETC_DIR=${ROOTDIR}/etc/webconsole/console TMP_DIR=${ETC_DIR}/.backoutpatch_tmp RESTART_FLAG=${TMP_DIR}/restart # 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 fi exit 0