Index: /branches/rel_apv_10_7_2/usr/click/bin/sync/remote
===================================================================
--- /branches/rel_apv_10_7_2/usr/click/bin/sync/remote	(revision 38784)
+++ /branches/rel_apv_10_7_2/usr/click/bin/sync/remote	(working copy)
@@ -290,12 +290,6 @@
 						fi		
 					elif [ "$2" = "to" ]
 					then
-						# Bug 786_PATCH_START
-						# Make a backup of /var/run/webui_server.pem before Sync
-						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x '/usr/bin/chown ansync:root /var/run' > /dev/null 2>&1"
-						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x 'cp -f /var/run/webui_server.pem /var/run/webui_server_backup.pem' > /dev/null 2>&1"
-						# Bug 786_PATCH_END
-					
 						#sync to is a push configuration operation.
 						#1. create config dir
 						#2. modify config dir attribute
@@ -306,6 +300,8 @@
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x 'rm -f /ca/sync/$config_dir' > /dev/null 2>&1"
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x '/usr/bin/mkdir /ca/sync/$config_dir' > /dev/null 2>&1"
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x '/usr/bin/chown ansync:root /ca/sync/$config_dir' > /dev/null 2>&1"
+                                                # Make a backup of /var/run/webui_server.pem before Sync
+                                                $SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x 'cp -f /var/run/webui_server.pem /ca/sync/webui_server_backup.pem' > /dev/null 2>&1"
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x '/usr/bin/mkdir /ca/sync/$config_dir/segment' > /dev/null 2>&1"
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x '/usr/bin/chown ansync:root /ca/sync/$config_dir/segment' > /dev/null 2>&1"
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x '/usr/bin/chown ansync:root /ca/sync/log' > /dev/null 2>&1"
@@ -313,14 +309,12 @@
 						/ca/sync/sync $9 to "" $6 $dst_ip $segment_name > /ca/sync/log/$9.log
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/sync $9 load_config \"\" $6 $dst_ip $segment_name $segment_user > /ca/sync/log/$9.log"
 
-						# Bug 786_PATCH_START
 						# Copy the webui_server_backup.pem (created before Sync) with the original webui_server.pem, and delete the backup file
-						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x 'cp -f /var/run/webui_server_backup.pem /var/run/webui_server.pem' > /dev/null 2>&1"
-						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x 'rm -f /var/run/webui_server_backup.pem' > /dev/null 2>&1"
+						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x 'cp -f /ca/sync/webui_server_backup.pem /var/run/webui_server.pem' > /dev/null 2>&1"
+						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -x 'rm -f /ca/sync/webui_server_backup.pem' > /dev/null 2>&1"
 						# Webui Off and On for reloading the certificate on browser
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -l 'webui off' -f "config" > /dev/null 2>&1"
 						$SYNC_CMD $SYNC_OPT $dst_ip "/ca/sync/munch -l 'webui on' -f "config" > /dev/null 2>&1"
-						# Bug 786_PATCH_END
 
 					elif [ "$2" = "incto" ]
 					then
