Skip to content

Commit

Permalink
Fixes to previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Oct 21, 2017
1 parent e1fd1fc commit afd1f90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vyatta-cjdns/opt/vyatta/sbin/vyatta-cjdns-readconf
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,23 @@ def showConnectionUsernames():
print block['user']

def showConnectionDetails(user):
listedPorts = []
for block in data['authorizedPasswords']:
if block['user'] == user:
for bind in data['interfaces']['UDPInterface']:
if bind['bind'] == "": continue
print '"{}":'.format(bind['bind']), '{'
tokens = bind['bind'].split(":")
if len(tokens) < 2: continue
if tokens[1] in listedPorts: continue
listedPorts += tokens[1]
print '"ip-address:{}":'.format(tokens[-1]), '{'
print ' "publicKey": "{}",'.format(data['publicKey'])
print ' "login": "{}",'.format(block['user'])
print ' "password": "{}"'.format(block['password'])
print '}'
return
print "No such user found"

try:
if sys.argv[2] == "getAdminAddress": getAdminAddress()
if sys.argv[2] == "getAdminPassword": getAdminPassword()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tag:
allowed: /opt/vyatta/sbin/vyatta-cjdns-readconf $4 showConnectionUsernames
run: /opt/vyatta/sbin/vyatta-cjdns-readconf $4 showConnectionDetails $6
help: Show connection details for a given username

0 comments on commit afd1f90

Please sign in to comment.