]> rtime.felk.cvut.cz Git - socketcan-simulink.git/blobdiff - demo/canopen_2j_arm/run_model.sh
Run model script uses local target-ssh-key only if it is present.
[socketcan-simulink.git] / demo / canopen_2j_arm / run_model.sh
index b3b26b2433c6e85bd2d6c24f967d705fefe7ea50..b1c200b4efa324cbabb93d5ff85316385e4e4e0e 100755 (executable)
@@ -2,7 +2,11 @@
 
 if [ -n "$2" ] ; then
 
-  xterm -e "scp -i target-ssh-key ./$1 root@$2:/tmp ; 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