summaryrefslogtreecommitdiff
path: root/env/files/getip.py
diff options
context:
space:
mode:
Diffstat (limited to 'env/files/getip.py')
-rwxr-xr-xenv/files/getip.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/env/files/getip.py b/env/files/getip.py
new file mode 100755
index 0000000..a8b326d
--- /dev/null
+++ b/env/files/getip.py
@@ -0,0 +1,13 @@
+#!/usr/bin/python3
+
+import json
+import sys
+
+
+leases = sys.argv[1]
+hostname = sys.argv[2]
+o = json.load(open(leases))
+
+for h in o:
+ if h["hostname"] == hostname:
+ print(h["ip-address"])