Revision: 7920
http://syscheck.svn.sourceforge.net/syscheck/?rev=7920&view=rev
Author: kinneh
Date: 2010-10-19 12:10:46 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
Closes #38 add a pre-upgrade script to copy all key config/keystores to /tmp/backup_htmf_conf
Modified Paths:
--------------
trunk/syscheck/lang/926.english
trunk/syscheck/related-available/926_local_htmf_copy_conf.sh
Modified: trunk/syscheck/lang/926.english
===================================================================
--- trunk/syscheck/lang/926.english 2010-10-19 11:53:31 UTC (rev 7919)
+++ trunk/syscheck/lang/926.english 2010-10-19 12:10:46 UTC (rev 7920)
@@ -0,0 +1,8 @@
+HELP="Copy all config/keystore files to /tmp/bckup_htmf_conf before system upgrade"
+DESCR_1="File copied ok(%s)"
+HELP_1="no action needed"
+DESCR_2="Failed to copy file (%s)"
+HELP_2="check permissions and paths"
+DESCR_3="Failed to create backup dir (%s)"
+HELP_3="check permissions and paths"
+
Modified: trunk/syscheck/related-available/926_local_htmf_copy_conf.sh
===================================================================
--- trunk/syscheck/related-available/926_local_htmf_copy_conf.sh 2010-10-19 11:53:31 UTC (rev 7919)
+++ trunk/syscheck/related-available/926_local_htmf_copy_conf.sh 2010-10-19 12:10:46 UTC (rev 7920)
@@ -22,7 +22,7 @@
. $SYSCHECK_HOME/config/related-scripts.conf
# uniq ID of script (please use in the name of this file also for convinice for finding next availavle number)
-SCRIPTID=921
+SCRIPTID=926
getlangfiles $SCRIPTID
getconfig $SCRIPTID
@@ -35,9 +35,9 @@
PRINTTOSCREEN=1
if [ "x$1" = "x-h" -o "x$1" = "x--help" ] ; then
- echo "$ECRT_HELP"
- echo "$ERRNO_1/$COPY_EJBCA_CONF_DESCR_1 - $COPY_EJBCA_CONF_HELP_1"
- echo "$ERRNO_2/$COPY_EJBCA_CONF_DESCR_2 - $COPY_EJBCA_CONF_HELP_2"
+ echo "$HELP"
+ echo "$ERRNO_1/$DESCR_1 - $HELP_1"
+ echo "$ERRNO_2/$DESCR_2 - $HELP_2"
echo "${SCREEN_HELP}"
exit
elif [ "x$1" = "x-s" -o "x$1" = "x--screen" -o \
@@ -49,19 +49,21 @@
# Make sure you add quotation marks for the first argument when adding new files that should be copied, for exampel.
-${SYSCHECK_HOME}/related-enabled/915_remote_command_via_ssh.sh ${HOSTNAME_NODE2} "mkdir -p ${REMOTE_DIR}" ${SSH_USER} ${SSHKEY}
+mkdir -p ${BACKUP_DIR}
if [ $? -ne 0 ] ; then
- echo "couldn't make dir"
- exit
+ printlogmess $ERROR $ERRNO_3 "$DESCR_3" "${BACKUP_DIR}"
+ exit
fi
for (( j=0; j < ${#HTMF_FILE[@]} ; j++ )){
- printtoscreen "Copying file: ${HTMF_FILE[$j]} to:${HOSTNAME_NODE2} dir:${REMOTE_DIR} remotreuser:${REMOTE_USER} sshkey: ${SSHKEY}"
- ${SYSCHECK_HOME}/related-enabled/906_ssh-copy-to-remote-machine.sh "${HTMF_FILE[$j]}" ${HOSTNAME_NODE2} ${REMOTE_DIR} ${REMOTE_USER} ${SSHKEY}
+ printtoscreen "Copying file: ${HTMF_FILE[$j]} to:${BACKUP_DIR}"
+ cp -f "${HTMF_FILE[$j]}" ${BACKUP_DIR}
if [ $? -ne 0 ] ; then
- echo "couln't copy file \"${HTMF_FILE[$j]}\""
- exit
+ printlogmess $ERROR $ERRNO_3 "$DESCR_3" ${HTMF_FILE[$j]}
+ continue
+ else
+ printlogmess $INFO $ERRNO_2 "$DESCR_2" ${HTMF_FILE[$j]}
fi
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|