Révision | 58e4a40e7e0d7ff6eb03866734cb0244df3c9fab (tree) |
---|---|
l'heure | 2010-10-04 14:26:48 |
Auteur | 0809216 <0809216@1ed6...> |
Commiter | 0809216 |
Change file name
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10325 1ed66053-1c2d-0410-8867-f7571e6e31d3
@@ -1,7 +1,7 @@ | ||
1 | 1 | #!/bin/bash |
2 | 2 | |
3 | -#Save configfiles and logfiles. | |
4 | -LOG "save_file start." | |
3 | +# Backup config files and log files. | |
4 | +LOG "backup_file start." | |
5 | 5 | |
6 | 6 | if [ -e /etc/hosts ] |
7 | 7 | then |
@@ -15,9 +15,9 @@ else | ||
15 | 15 | fi |
16 | 16 | if [ $? -ne 0 ] |
17 | 17 | then |
18 | - LOG_ERR "/etc/hosts file move failed." | |
18 | + LOG_ERR "Cannot move /etc/hosts file." | |
19 | 19 | else |
20 | - LOG "/etc/hosts file moved ${TMP_DIR}/etc ." | |
20 | + LOG "/etc/hosts file was moved to ${TMP_DIR}/etc/hosts." | |
21 | 21 | fi |
22 | 22 | |
23 | 23 | if [ -n ${L7VSD_CONF_DIR} -a ${L7VSD_CONF_DIR} != "/" ] |
@@ -32,12 +32,11 @@ else | ||
32 | 32 | fi |
33 | 33 | if [ $? -ne 0 ] |
34 | 34 | then |
35 | - LOG_ERR "l7vs config file move failed." | |
35 | + LOG_ERR "Cannot move ${L7VSD_CONF_DIR}/* files." | |
36 | 36 | else |
37 | - LOG "l7vs config file moved ${TMP_DIR}/l7vs ." | |
37 | + LOG "${L7VSD_CONF_DIR}/* files were moved to ${TMP_DIR}/l7vs directory." | |
38 | 38 | fi |
39 | 39 | |
40 | - | |
41 | 40 | if [ -n ${L7DIRECTORD_CONF_DIR} -a ${L7DIRECTORD_CONF_DIR} != "/" ] |
42 | 41 | then |
43 | 42 | if [ ! -d ${TMP_DIR}/l7director ] |
@@ -50,12 +49,11 @@ else | ||
50 | 49 | fi |
51 | 50 | if [ $? -ne 0 ] |
52 | 51 | then |
53 | - LOG_ERR "l7director config file move failed." | |
52 | + LOG_ERR "Cannot move ${L7DIRECTORD_CONF_DIR}/* files." | |
54 | 53 | else |
55 | - LOG "l7director config file moved ${TMP_DIR}/l7direcotr ." | |
54 | + LOG "${L7DIRECTORD_CONF_DIR}/* files were moved to ${TMP_DIR}/l7direcotr directory." | |
56 | 55 | fi |
57 | 56 | |
58 | - | |
59 | 57 | if [ -n ${L7VS_LOG_DIR} -a ${L7VS_LOG_DIR} != "/" ] |
60 | 58 | then |
61 | 59 | if [ ! -d ${TMP_DIR}/log ] |
@@ -68,9 +66,9 @@ else | ||
68 | 66 | fi |
69 | 67 | if [ $? -ne 0 ] |
70 | 68 | then |
71 | - LOG_ERR "UM-L7's log file move failed." | |
69 | + LOG_ERR "Cannot move ${L7VS_LOG_DIR}/* files." | |
72 | 70 | else |
73 | - LOG "UM-L7's log file moved ${TMP_DIR}log ." | |
71 | + LOG "${L7VS_LOG_DIR}/* files were moved to ${TMP_DIR}log directory." | |
74 | 72 | fi |
75 | 73 | |
76 | -LOG "save_file end." | |
74 | +LOG "backup_file end." |
@@ -0,0 +1,38 @@ | ||
1 | +#!/bin/bash | |
2 | + | |
3 | +# Restore config files and log files. | |
4 | +LOG "restore_file start." | |
5 | + | |
6 | +\mv -f ${TMP_DIR}/etc/hosts /etc/hosts 2> /dev/null | |
7 | +if [ $? -ne 0 ] | |
8 | +then | |
9 | + LOG_ERR "Cannot move ${TMP_DIR}/etc/hosts file." | |
10 | +else | |
11 | + LOG "/etc/hosts file was restored." | |
12 | +fi | |
13 | + | |
14 | +mv ${TMP_DIR}/l7vs/* ${L7VSD_CONF_DIR} 2> /dev/null | |
15 | +if [ $? -ne 0 ] | |
16 | +then | |
17 | + LOG_ERR "Cannot move ${TMP_DIR}/l7vs/* files." | |
18 | +else | |
19 | + LOG "${L7VSD_CONF_DIR}/* files were restored." | |
20 | +fi | |
21 | + | |
22 | +mv ${TMP_DIR}/l7director/* ${L7DIRECTORD_CONF_DIR} 2> /dev/null | |
23 | +if [ $? -ne 0 ] | |
24 | +then | |
25 | + LOG_ERR "Cannot move ${TMP_DIR}/l7director/* files." | |
26 | +else | |
27 | + LOG "${L7DIRECTORD_CONF_DIR}/* files were restored." | |
28 | +fi | |
29 | + | |
30 | +mv ${TMP_DIR}/log/* ${L7VS_LOG_DIR} 2> /dev/null | |
31 | +if [ $? -ne 0 ] | |
32 | +then | |
33 | + LOG_ERR "Cannot move ${TMP_DIR}/log/* files." | |
34 | +else | |
35 | + LOG "${L7VS_LOG_DIR}/* files were restored." | |
36 | +fi | |
37 | + | |
38 | +LOG "restore_file end." |
@@ -1,38 +0,0 @@ | ||
1 | -#!/bin/bash | |
2 | - | |
3 | -#Return configfiles and logfiles. | |
4 | -LOG "return_file start." | |
5 | - | |
6 | -\mv -f ${TMP_DIR}/etc/hosts /etc/hosts 2> /dev/null | |
7 | -if [ $? -ne 0 ] | |
8 | -then | |
9 | - LOG_ERR "${TMP_DIR}/etc/hosts file move failed." | |
10 | -else | |
11 | - LOG "/etc/hosts file return ${L7VSD_CONF_DIR} ." | |
12 | -fi | |
13 | - | |
14 | -mv ${TMP_DIR}/l7vs/* ${L7VSD_CONF_DIR} 2> /dev/null | |
15 | -if [ $? -ne 0 ] | |
16 | -then | |
17 | - LOG_ERR "l7vs config file move failed." | |
18 | -else | |
19 | - LOG "l7vs config file return ${L7VSD_CONF_DIR} ." | |
20 | -fi | |
21 | - | |
22 | -mv ${TMP_DIR}/l7director/* ${L7DIRECTORD_CONF_DIR} 2> /dev/null | |
23 | -if [ $? -ne 0 ] | |
24 | -then | |
25 | - LOG_ERR "l7director config file move failed." | |
26 | -else | |
27 | - LOG "l7director config file return ${L7DIRECTORD_CONF_DIR} ." | |
28 | -fi | |
29 | - | |
30 | -mv ${TMP_DIR}/log/* ${L7VS_LOG_DIR} 2> /dev/null | |
31 | -if [ $? -ne 0 ] | |
32 | -then | |
33 | - LOG_ERR "UM-L7's log file move failed." | |
34 | -else | |
35 | - LOG "UM-L7's log file return ${L7VS_LOG_DIR} ." | |
36 | -fi | |
37 | - | |
38 | -LOG "return_file end." |
@@ -12,8 +12,8 @@ CHECK_ENV="${COMMON_SCRIPT_DIR}/check_env.sh" | ||
12 | 12 | LOGGER="${COMMON_SCRIPT_DIR}/logger.sh" |
13 | 13 | LIGHTTPD_FUNC="${COMMON_SCRIPT_DIR}/lighttpd_func.sh" |
14 | 14 | STOP_MONKEY="${COMMON_SCRIPT_DIR}/stop_um_ps.sh" |
15 | -SAVE_FILE="${COMMON_SCRIPT_DIR}/save_file.sh" | |
16 | -RETURN_FILE="${COMMON_SCRIPT_DIR}/return_file.sh" | |
15 | +BACKUP_FILE="${COMMON_SCRIPT_DIR}/backup_file.sh" | |
16 | +RESTORE_FILE="${COMMON_SCRIPT_DIR}/restore_file.sh" | |
17 | 17 | COLLECT_FILE="${COMMON_SCRIPT_DIR}/collect_file.sh" |
18 | 18 | SET_DEFAULT_CONF="${COMMON_SCRIPT_DIR}/set_default_conf.sh" |
19 | 19 | START_SNMPD="${COMMON_SCRIPT_DIR}/start_snmpd.sh" |
@@ -163,8 +163,8 @@ shift `expr "$OPTIND" - 1` | ||
163 | 163 | . ${CHECK_ENV} |
164 | 164 | # Stop UltraMonkey-L7. |
165 | 165 | . ${STOP_MONKEY} |
166 | -# Save log and config files. | |
167 | -. ${SAVE_FILE} | |
166 | +# Backup log and config files. | |
167 | +. ${BACKUP_FILE} | |
168 | 168 | # Initialize environment. |
169 | 169 | \cp -f ${CONF_DIR}/hosts /etc/hosts |
170 | 170 | . ${LIGHTTPD_FUNC} |
@@ -202,8 +202,8 @@ LOG "Test scripts end." | ||
202 | 202 | ################### |
203 | 203 | # Stop UltraMonkey-L7. |
204 | 204 | . ${STOP_MONKEY} |
205 | -# Return log and config files. | |
206 | -. ${RETURN_FILE} | |
205 | +# Restore log and config files. | |
206 | +. ${RESTORE_FILE} | |
207 | 207 | # Delete temp directory |
208 | 208 | rm -rf ${TMP_DIR} |
209 | 209 | exit 0 |