mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-08-28 02:55:05 +08:00
servefiles: Add optional host IP argument.
This commit is contained in:
parent
40b6163a27
commit
5f4e9406bb
@ -29,9 +29,14 @@ if not os.path.exists(directory):
|
||||
print(directory + ": No such file or directory.")
|
||||
sys.exit(1)
|
||||
|
||||
if len(sys.argv) >= 4:
|
||||
hostIp = sys.argv[3]
|
||||
else:
|
||||
hostIp = [(s.connect(('8.8.8.8', 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]
|
||||
|
||||
print("Preparing data...")
|
||||
|
||||
baseUrl = [(s.connect(('8.8.8.8', 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1] + ":8080/"
|
||||
baseUrl = hostIp + ":8080/"
|
||||
payload = ""
|
||||
|
||||
if os.path.isfile(directory):
|
||||
|
Loading…
x
Reference in New Issue
Block a user