From 61c44b62674520802b37c00d824750d26990fff4 Mon Sep 17 00:00:00 2001 From: WXbet Date: Tue, 18 Feb 2020 16:44:52 +0100 Subject: [PATCH] New option backup_target in profiles to backup the targetcam before replacing --- support/functions/_uploadcam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 support/functions/_uploadcam diff --git a/support/functions/_uploadcam b/support/functions/_uploadcam old mode 100644 new mode 100755 index 8f02ef6..e998e17 --- a/support/functions/_uploadcam +++ b/support/functions/_uploadcam @@ -37,7 +37,7 @@ upload_cam(){ if [ "$replace_target" == "y" ];then echo -en "$p_l REPLACE > $y_l$targetcam$re_"; sshpass -p "$password" ssh -p "$port" -o StrictHostKeyChecking=no "$loginname@$ip" \ - "cd /tmp;if [ -f \"$buildcamname\" ];then if [ -f \"$targetcam\" ];then mv -f \"$buildcamname\" \"$targetcam\";fi;fi;exit;"; + "cd /tmp;if [ -f \"$buildcamname\" ];then if [ -f \"$targetcam\" ];then if [ \"$backup_target\" == \"y\" ]; then cp -pf \"$targetcam\" \"$targetcam.backup\"; fi;mv -f \"$buildcamname\" \"$targetcam\";fi;fi;exit;"; echo -e "$g_l$txt_done!$re_"; fi;