login script

Hiiii. I have a very specific question, so I coded a script for my MacBook. After it's done, it sends it all to my email, this happens every time the password is entered. When I enter my password and login, and automator app activates, now, my question is, is there a way to actually do this on my iPad as well I pasted the clean code below

#!/usr/bin/env import os

Path [REMOVED OR GENERALIZED]

import sys

Path [REMOVED OR GENERALIZED]

import subprocess import datetime import psutil import pyautogui

Email functionality [REMOVED OR GENERALIZED]

Email functionality [REMOVED OR GENERALIZED]

Email functionality [REMOVED OR GENERALIZED]

###############################################################################################################################

[Sensitive Data Removed or Generalized]

process = subprocess.Popen(["pmset", "-g", "batt"], stdout=subprocess.PIPE)
output, _ = process.communicate()
output = output.decode("utf-8")
start = output.find('InternalBattery-0') + 17
end = output.find('%', start)
return output[start:end].strip()

[Sensitive Data Removed or Generalized]

process = subprocess.Popen(["networksetup", "-listallhardwareports"], stdout=subprocess.PIPE)
output, _ = process.communicate()
return output.decode("utf-8")

[Sensitive Data Removed or Generalized]

process = subprocess.Popen(["system_profiler", "SPUSBDataType"], stdout=subprocess.PIPE)
output, _ = process.communicate()
return output.decode("utf-8")

[Sensitive Data Removed or Generalized]

cpu_usage = psutil.cpu_percent()
memory_usage = psutil.virtual_memory().percent
return f"CPU Usage: {cpu_usage}%, Memory Usage: {memory_usage}%"

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

process = subprocess.Popen(["osascript", "-e", 'tell application "System Events" to get the name of every process whose background only is false'], stdout=subprocess.PIPE)
output, _ = process.communicate()
return output.decode("utf-8")

[Sensitive Data Removed or Generalized]

Path [REMOVED OR GENERALIZED]

output, _ = process.communicate()
return output.decode("utf-8")

def send_email(subject, body, to_email, from_email, password = '[REMOVED]'

Email functionality [REMOVED OR GENERALIZED]

msg['From'] = from_email = '[REMOVED]'
msg['To'] = to_email = '[REMOVED]'
msg['Subject'] = subject

Email functionality [REMOVED OR GENERALIZED]

Email functionality [REMOVED OR GENERALIZED]

server.starttls()
server.login(from_email, password = '[REMOVED]'
server.send_message(msg)
server.quit()

[Sensitive Data Removed or Generalized]

Path [REMOVED OR GENERALIZED]

    output, _ = process.communicate()
    return output.decode("utf-8").strip()

[Sensitive Data Removed or Generalized]

process = subprocess.Popen(["softwareupdate", "--list"], stdout=subprocess.PIPE)
output, _ = process.communicate()
return output.decode("utf-8")

[Sensitive Data Removed or Generalized]

process = subprocess.Popen(["/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport", "-I"], stdout=subprocess.PIPE)
output, _ = process.communicate()
return output.decode("utf-8")

[Sensitive Data Removed or Generalized]

process = subprocess.Popen(["/usr/libexec/ApplicationFirewall/socketfilterfw", "--getglobalstate"], stdout=subprocess.PIPE)
output, _ = process.communicate()
return output.decode("utf-8").strip()

[Sensitive Data Removed or Generalized]

    process = subprocess.Popen(["uptime"], stdout=subprocess.PIPE)
    # Parse the output to extract uptime information
    output, _ = process.communicate()
    # Implement your parsing logic here
    return output.decode("utf-8").strip().upper()

[Sensitive Data Removed or Generalized]

try:
    cpu_usage = psutil.cpu_percent(interval=1)
    # GPU tracking is more complex and hardware-specific. 
    # You might need to use a specialized library or tool depending on your GPU.
    gpu_usage = "GPU tracking not implemented"  # Placeholder

    return f"CPU LOAD: {cpu_usage}%\nGPU LOAD: {gpu_usage}".upper()  # Convert to uppercase for emphasis
except Exception as e:

[Sensitive Data Removed or Generalized]

###############################################################################################################################

def create_log_file():

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

log_data = "---------- System Log Report ----------\n"
log_data += f"Date and Time: {current_time}\n\n"

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

log_data += "----------------------------------------\n"

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

log_data += "----------------------------------------\n"

[Sensitive Data Removed or Generalized]

[Sensitive Data Removed or Generalized]

# Email variables (replace placeholders with your actual information)
subject = "System Log Report"
to_email = '[REMOVED]'
from_email = '[REMOVED]'
app_specific_password = '[REMOVED]'

# Send the email = '[REMOVED]'
send_email(subject, log_data, to_email, from_email, app_specific_password = '[REMOVED]'

create_log_file()

login script
 
 
Q