add command to show office IP address

workspace
Brendan Howell 8 years ago
parent 84d32cc8a1
commit d8f2502bf2

@ -1,6 +1,7 @@
import json
import os
import signal
import socket
import subprocess
import code128
@ -113,6 +114,14 @@ class InhumanResources(Bureau):
"""
self.print_full("menu.html", menu=self.menu)
@add_command("getmyip", "Print Office IP Address")
def print_my_ip(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.connect(("8.8.8.8", 80))
self.print_small("This Screenless Office currently resides at:\r\n" +
sock.getsockname()[0] + "\r\n")
sock.close()
@add_command("update", "Restructure Organization")
def update(self):
"""

Loading…
Cancel
Save