r4823 - developers/tick/scripts

tick at docs.openmoko.org tick at docs.openmoko.org
Tue Nov 25 09:22:33 CET 2008


Author: tick
Date: 2008-11-25 09:22:32 +0100 (Tue, 25 Nov 2008)
New Revision: 4823

Modified:
   developers/tick/scripts/sshn
Log:
A lazier script that help user to ssh in Neo


Modified: developers/tick/scripts/sshn
===================================================================
--- developers/tick/scripts/sshn	2008-11-25 05:51:30 UTC (rev 4822)
+++ developers/tick/scripts/sshn	2008-11-25 08:22:32 UTC (rev 4823)
@@ -6,9 +6,17 @@
 	"inet6" {spawn sudo ifconfig usb0 192.168.0.200;interact}
 }
 
-spawn ssh -o stricthostkeychecking=no root at 192.168.0.202
-expect {
-    "Are you sure you want to continue connecting*" 
-    {send "yes\r";exp_continue}
-    "root@*'s password:*" {send "\r\n";interact}
+
+while 1 {
+    spawn ssh -o stricthostkeychecking=no root at 192.168.0.202
+    expect {
+        "Are you sure you want to continue connecting*" 
+        {send "yes\r";exp_continue}
+        "root@*'s password:*" {send "\r\n";interact; exit}
+        -regexp {Offending[[:space:]]+key[[:space:]]+in[[:space:]]+/home/([[:alpha:]]+)/\.ssh/known_hosts:([[:digit:]]+)} {
+                    set whoami  "$expect_out(1,string)"
+                    set delline "$expect_out(2,string)"
+                    exec sed -i ${delline}d /home/${whoami}/.ssh/known_hosts
+                }
+    }
 }




More information about the commitlog mailing list