projects
/
remote-debug.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bug of known host
[remote-debug.git]
/
suanzi-support
diff --git
a/suanzi-support
b/suanzi-support
index
8809b05
..
183f6de
100755
(executable)
--- a/
suanzi-support
+++ b/
suanzi-support
@@
-7,7
+7,6
@@
from subprocess import call, Popen, PIPE, STDOUT
import paho.mqtt.client as mqtt
import shlex
from subprocess import call, Popen, PIPE, STDOUT
import paho.mqtt.client as mqtt
import shlex
-import os
import random
from uuid import getnode as get_mac
import random
from uuid import getnode as get_mac
@@
-39,7
+38,7
@@
def getAvailablePort(host, ports):
def exec_ssh(port):
if port == None:
raise Exception('Port not avaliable')
def exec_ssh(port):
if port == None:
raise Exception('Port not avaliable')
- command = 'sshpass -p' + PASSWORD + ' ssh -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -fCR ' + str(port) +':localhost:22 ' + USER + '@' + SSH_SERVER + ' sleep ' + str(ALIVE_TIME)
+ command = 'sshpass -p' + PASSWORD + ' ssh -o "S
trictHostKeyChecking=no" -o "UserKnownHostsFile /dev/null" -o "S
erverAliveInterval 60" -o "ServerAliveCountMax 3" -fCR ' + str(port) +':localhost:22 ' + USER + '@' + SSH_SERVER + ' sleep ' + str(ALIVE_TIME)
print command
return call(shlex.split(command), shell=False)
print command
return call(shlex.split(command), shell=False)
@@
-67,7
+66,7
@@
class MyClient(mqtt.Client):
if __name__ == '__main__':
mac = hex(get_mac())
if __name__ == '__main__':
mac = hex(get_mac())
- id =
os.getenv('USER') + '-' + '{:0>12}'.format(mac[2:13
])
+ id =
'{:0>12}'.format(mac[2:-1
])
print 'id is: ' , id
client = MyClient(id)
client.connect(MQTT_SERVER, MQTT_PORT, 60)
print 'id is: ' , id
client = MyClient(id)
client.connect(MQTT_SERVER, MQTT_PORT, 60)