MCPcopy Index your code
hub / github.com/geekcomputers/Python / main

Function main

powerup_checks.py:98–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96
97
98def main(): # Main Function
99 if os.path.exists(serverfile): # Checks to see if there is an existing server file
100 os.remove(serverfile) # If so remove it
101
102 if len(sys.argv) < 2: # Check there is an argument being passed
103 print(text) # Display the help text if there isn't one passed
104 sys.exit() # Exit the script
105
106 if (
107 "-h" in sys.argv
108 or "--h" in sys.argv
109 or "-help" in sys.argv
110 or "--help" in sys.argv
111 ): # If the ask for help
112 print(text) # Display the help text if there isn't one passed
113 sys.exit(0) # Exit the script after displaying help
114 else:
115 if sys.argv[1].lower().startswith("-site1"): # If the argument is site1
116 query = "site1" # Set the variable to have the value site
117 elif (
118 sys.argv[1].lower().startswith("-site2")
119 ): # Else if the variable is bromley
120 query = "site2" # Set the variable to have the value bromley
121 else:
122 print(
123 "\n[-] Unknown option [-] " + text
124 ) # If an unknown option is passed, let the user know
125 sys.exit(0)
126 get_servers(query) # Call the get servers funtion, with the value from the argument
127
128 if os.name == "posix": # If the OS is linux.
129 linux() # Call the linux function
130 elif os.name in ("nt", "dos", "ce"): # If the OS is Windows...
131 windows() # Call the windows function
132
133 print(
134 "\n[+] Check the log file " + outputfile + " [+]\n"
135 ) # Display the name of the log
136
137
138if __name__ == "__main__":

Callers 1

powerup_checks.pyFile · 0.70

Calls 4

get_serversFunction · 0.85
linuxFunction · 0.70
windowsFunction · 0.70
removeMethod · 0.45

Tested by

no test coverage detected