This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import subprocess | |
import requests | |
import json | |
from urllib.parse import urlparse | |
# Step 1: Create WHM session | |
def create_whm_session(): | |
result = subprocess.check_output( | |
['whmapi1', '--output=json', 'create_user_session', 'user=root', 'service=whostmgrd'] |