mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-23 22:01:01 +00:00
tools: drop netifaces requirement from keyctl-proxy
This commit is contained in:
parent
132660c378
commit
f0152902fc
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import binascii
|
import binascii
|
||||||
import sys
|
import sys
|
||||||
import netifaces
|
|
||||||
import Pyro4
|
import Pyro4
|
||||||
import serpent
|
import serpent
|
||||||
|
|
||||||
@ -66,12 +65,11 @@ class KeyctlProxy(object):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
iface = sys.argv[1]
|
ipaddr = sys.argv[1]
|
||||||
else:
|
else:
|
||||||
print('Usage: keyctl-proxy interface')
|
print('Usage: keyctl-proxy ipaddress')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
host = netifaces.ifaddresses(iface)[netifaces.AF_INET][0]['addr']
|
daemon = Pyro4.Daemon(host=ipaddr, port=PORT)
|
||||||
daemon = Pyro4.Daemon(host=host, port=PORT)
|
|
||||||
proxy = KeyctlProxy()
|
proxy = KeyctlProxy()
|
||||||
uri = daemon.register(proxy, 'keyctl')
|
uri = daemon.register(proxy, 'keyctl')
|
||||||
print('keyctl-proxy running at URI: "%s"' % uri)
|
print('keyctl-proxy running at URI: "%s"' % uri)
|
||||||
|
Loading…
Reference in New Issue
Block a user