From d3b0932730a2d1da7cc34486770f6534a70e905f Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Fri, 10 Oct 2014 20:18:35 +0200 Subject: [PATCH] Run model script uses local target-ssh-key only if it is present. Signed-off-by: Pavel Pisa --- demo/canopen_2j_arm/run_model.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/canopen_2j_arm/run_model.sh b/demo/canopen_2j_arm/run_model.sh index 1064eff..b1c200b 100755 --- a/demo/canopen_2j_arm/run_model.sh +++ b/demo/canopen_2j_arm/run_model.sh @@ -2,7 +2,11 @@ if [ -n "$2" ] ; then - xterm -e "scp -i target-ssh-key ./$1 canopen_2j_arm_setup root@$2:/tmp ; echo CAN setup ; ssh -i target-ssh-key root@$2 /tmp/canopen_2j_arm_setup ; echo model $1 copied to target is run ; ssh -i target-ssh-key root@$2 /tmp/$1 -tf inf -w ; sleep 2" & + if [ -e target-ssh-key ] ; then + SSH_LOCAL_KEY_OPT="-i target-ssh-key" + fi + + xterm -e "scp $SSH_LOCAL_KEY_OPT ./$1 canopen_2j_arm_setup root@$2:/tmp ; echo CAN setup ; ssh $SSH_LOCAL_KEY_OPT root@$2 /tmp/canopen_2j_arm_setup ; echo model $1 copied to target is run ; ssh $SSH_LOCAL_KEY_OPT root@$2 /tmp/$1 -tf inf -w ; sleep 2" & else -- 2.39.2