#!/bin/sh # define common locations and temp dirs BIN_DIR=/usr/share/webconsole/bin ETC_DIR=${ROOTDIR}/etc/webconsole/console/ WEBCONSOLE_TMP_DIR=${ROOTDIR}/var/webconsole/tmp TMP_DIR=${ETC_DIR}/.patch_tmp RESTART_FLAG=${TMP_DIR}/restart # restore cached configuration cp ${TMP_DIR}/config.properties ${ETC_DIR} if [ $? -ne 0 ];then echo "Unable to restore configuration" exit 1 fi # Only execute commands if patching live system. if [ "${ROOTDIR}" = "" -o "${ROOTDIR}" = "/" ]; then # determine console status, start if necessary, # set flag for restart after the patch is applied if [ -f ${RESTART_FLAG} ];then # restart the server ${BIN_DIR}/smcwebserver restart fi fi # remove temporary directory rm -rf ${TMP_DIR} # set the sticky bit on the var/webconsole/tmp chmod 1777 ${WEBCONSOLE_TMP_DIR} exit 0