Find ipv4 address when server created

This commit is contained in:
Chandler Swift 2024-08-03 23:52:20 -05:00
parent a3cf49de01
commit 75f7dfa9ed
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F

View file

@ -8,6 +8,7 @@ import json
import argparse
import os
import base64
import time
nixos_infect_script="""
#!/bin/sh
@ -73,3 +74,11 @@ if input("Confirm? ")[0] != 'y':
res = requests.post("https://api.vultr.com/v2/instances", headers=headers, data=json.dumps(data)).json()
print(res)
print("Checking for ipv4...", end="", flush=True)
while res['instance']['main_ip'] == '0.0.0.0':
print('.', end="", flush=True)
res = requests.get(f"https://api.vultr.com/v2/instances/{res['instance']['id']}", headers=headers).json()
time.sleep(5)
print(res['instance']['main_ip'])