#!/bin/bash
-#Save configfiles and logfiles.
-LOG "save_file start."
+# Backup config files and log files.
+LOG "backup_file start."
if [ -e /etc/hosts ]
then
fi
if [ $? -ne 0 ]
then
- LOG_ERR "/etc/hosts file move failed."
+ LOG_ERR "Cannot move /etc/hosts file."
else
- LOG "/etc/hosts file moved ${TMP_DIR}/etc ."
+ LOG "/etc/hosts file was moved to ${TMP_DIR}/etc/hosts."
fi
if [ -n ${L7VSD_CONF_DIR} -a ${L7VSD_CONF_DIR} != "/" ]
fi
if [ $? -ne 0 ]
then
- LOG_ERR "l7vs config file move failed."
+ LOG_ERR "Cannot move ${L7VSD_CONF_DIR}/* files."
else
- LOG "l7vs config file moved ${TMP_DIR}/l7vs ."
+ LOG "${L7VSD_CONF_DIR}/* files were moved to ${TMP_DIR}/l7vs directory."
fi
-
if [ -n ${L7DIRECTORD_CONF_DIR} -a ${L7DIRECTORD_CONF_DIR} != "/" ]
then
if [ ! -d ${TMP_DIR}/l7director ]
fi
if [ $? -ne 0 ]
then
- LOG_ERR "l7director config file move failed."
+ LOG_ERR "Cannot move ${L7DIRECTORD_CONF_DIR}/* files."
else
- LOG "l7director config file moved ${TMP_DIR}/l7direcotr ."
+ LOG "${L7DIRECTORD_CONF_DIR}/* files were moved to ${TMP_DIR}/l7direcotr directory."
fi
-
if [ -n ${L7VS_LOG_DIR} -a ${L7VS_LOG_DIR} != "/" ]
then
if [ ! -d ${TMP_DIR}/log ]
fi
if [ $? -ne 0 ]
then
- LOG_ERR "UM-L7's log file move failed."
+ LOG_ERR "Cannot move ${L7VS_LOG_DIR}/* files."
else
- LOG "UM-L7's log file moved ${TMP_DIR}log ."
+ LOG "${L7VS_LOG_DIR}/* files were moved to ${TMP_DIR}log directory."
fi
-LOG "save_file end."
+LOG "backup_file end."
--- /dev/null
+#!/bin/bash
+
+# Restore config files and log files.
+LOG "restore_file start."
+
+\mv -f ${TMP_DIR}/etc/hosts /etc/hosts 2> /dev/null
+if [ $? -ne 0 ]
+then
+ LOG_ERR "Cannot move ${TMP_DIR}/etc/hosts file."
+else
+ LOG "/etc/hosts file was restored."
+fi
+
+mv ${TMP_DIR}/l7vs/* ${L7VSD_CONF_DIR} 2> /dev/null
+if [ $? -ne 0 ]
+then
+ LOG_ERR "Cannot move ${TMP_DIR}/l7vs/* files."
+else
+ LOG "${L7VSD_CONF_DIR}/* files were restored."
+fi
+
+mv ${TMP_DIR}/l7director/* ${L7DIRECTORD_CONF_DIR} 2> /dev/null
+if [ $? -ne 0 ]
+then
+ LOG_ERR "Cannot move ${TMP_DIR}/l7director/* files."
+else
+ LOG "${L7DIRECTORD_CONF_DIR}/* files were restored."
+fi
+
+mv ${TMP_DIR}/log/* ${L7VS_LOG_DIR} 2> /dev/null
+if [ $? -ne 0 ]
+then
+ LOG_ERR "Cannot move ${TMP_DIR}/log/* files."
+else
+ LOG "${L7VS_LOG_DIR}/* files were restored."
+fi
+
+LOG "restore_file end."
+++ /dev/null
-#!/bin/bash
-
-#Return configfiles and logfiles.
-LOG "return_file start."
-
-\mv -f ${TMP_DIR}/etc/hosts /etc/hosts 2> /dev/null
-if [ $? -ne 0 ]
-then
- LOG_ERR "${TMP_DIR}/etc/hosts file move failed."
-else
- LOG "/etc/hosts file return ${L7VSD_CONF_DIR} ."
-fi
-
-mv ${TMP_DIR}/l7vs/* ${L7VSD_CONF_DIR} 2> /dev/null
-if [ $? -ne 0 ]
-then
- LOG_ERR "l7vs config file move failed."
-else
- LOG "l7vs config file return ${L7VSD_CONF_DIR} ."
-fi
-
-mv ${TMP_DIR}/l7director/* ${L7DIRECTORD_CONF_DIR} 2> /dev/null
-if [ $? -ne 0 ]
-then
- LOG_ERR "l7director config file move failed."
-else
- LOG "l7director config file return ${L7DIRECTORD_CONF_DIR} ."
-fi
-
-mv ${TMP_DIR}/log/* ${L7VS_LOG_DIR} 2> /dev/null
-if [ $? -ne 0 ]
-then
- LOG_ERR "UM-L7's log file move failed."
-else
- LOG "UM-L7's log file return ${L7VS_LOG_DIR} ."
-fi
-
-LOG "return_file end."
LOGGER="${COMMON_SCRIPT_DIR}/logger.sh"
LIGHTTPD_FUNC="${COMMON_SCRIPT_DIR}/lighttpd_func.sh"
STOP_MONKEY="${COMMON_SCRIPT_DIR}/stop_um_ps.sh"
-SAVE_FILE="${COMMON_SCRIPT_DIR}/save_file.sh"
-RETURN_FILE="${COMMON_SCRIPT_DIR}/return_file.sh"
+BACKUP_FILE="${COMMON_SCRIPT_DIR}/backup_file.sh"
+RESTORE_FILE="${COMMON_SCRIPT_DIR}/restore_file.sh"
COLLECT_FILE="${COMMON_SCRIPT_DIR}/collect_file.sh"
SET_DEFAULT_CONF="${COMMON_SCRIPT_DIR}/set_default_conf.sh"
START_SNMPD="${COMMON_SCRIPT_DIR}/start_snmpd.sh"
. ${CHECK_ENV}
# Stop UltraMonkey-L7.
. ${STOP_MONKEY}
-# Save log and config files.
-. ${SAVE_FILE}
+# Backup log and config files.
+. ${BACKUP_FILE}
# Initialize environment.
\cp -f ${CONF_DIR}/hosts /etc/hosts
. ${LIGHTTPD_FUNC}
###################
# Stop UltraMonkey-L7.
. ${STOP_MONKEY}
-# Return log and config files.
-. ${RETURN_FILE}
+# Restore log and config files.
+. ${RESTORE_FILE}
# Delete temp directory
rm -rf ${TMP_DIR}
exit 0