projects
/
remote-debug.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8e379c4
)
Use hostname infor instead of users list
author
Peng Li
<seudut@gmail.com>
Sat, 28 Jul 2018 12:56:39 +0000
(20:56 +0800)
committer
Peng Li
<seudut@gmail.com>
Sat, 28 Jul 2018 12:56:39 +0000
(20:56 +0800)
board/suanzi-support
patch
|
blob
|
history
diff --git
a/board/suanzi-support
b/board/suanzi-support
index
3795d83
..
f55b41a
100755
(executable)
--- a/
board/suanzi-support
+++ b/
board/suanzi-support
@@
-39,11
+39,8
@@
def get_mac_str():
m = re.sub('^0x|L$', '', mac)
return '{:0>12}'.format(m)
m = re.sub('^0x|L$', '', mac)
return '{:0>12}'.format(m)
-
-def get_users():
- out = check_output("/bin/ls /home", shell=True).strip()
- out = out.strip().split()
- return " ".join(out)
+def get_hostname():
+ return check_output("/bin/hostname", shell=True).strip();
def exec_ssh(port):
if port == None:
def exec_ssh(port):
if port == None:
@@
-71,7
+68,7
@@
def on_message(client, userdata, msg):
else:
raise Exception ('run ssh failed')
if payload['command'] == 'list':
else:
raise Exception ('run ssh failed')
if payload['command'] == 'list':
- response = {'from': userdata['id'], 'type':'response', 'command':payload['command'], 'data': get_
users
()}
+ response = {'from': userdata['id'], 'type':'response', 'command':payload['command'], 'data': get_
hostname
()}
client.publish(payload['from'], str(response))
client.publish(payload['from'], str(response))