|
1 | 1 | #!/usr/bin/python3 |
2 | 2 | import os |
3 | 3 | import subprocess |
4 | | -from main.tools import banner |
| 4 | +from main.tools import banner,colors |
5 | 5 |
|
6 | | -def main(): |
| 6 | +def exit_program(): |
7 | 7 | os.system("clear") |
8 | 8 | banner.main() |
9 | | - banner.attack("Setup") |
10 | | - os.system("pip install -r requirements.txt") |
11 | | - os.system("sudo apt install golang -y") |
12 | | - os.system("go env -w GO111MODULE=on") |
13 | | - os.system("apt install php") |
14 | | - create_symlink() |
15 | | -def create_symlink(): |
16 | | - proc = subprocess.Popen([f"pwd"], stdout=subprocess.PIPE, shell=True) |
17 | | - #there keyfor success output and noththere for error output |
18 | | - (there, notthere) = proc.communicate() |
19 | | - there=there.decode() |
20 | | - there=there.split() |
21 | | - f = open("run.sh", "w") |
22 | | - f.write("#!/bin/bash") |
23 | | - f.write("\n") |
24 | | - f.write(f'cd {there[0]} && python3 cyberonix.py "$@"') |
25 | | - f.close() |
26 | | - os.system("chmod +x *") |
27 | | - os.system("sudo mv run.sh /usr/bin/cyberonix") |
28 | | - os.system("sudo mv cyberonix.1 /usr/local/man/man1/") |
29 | | - finish() |
30 | | -def finish(): |
| 9 | + print("\033[38;5;105m","[+] Thanks visit again".title()) |
| 10 | + exit() |
| 11 | +try: |
| 12 | + def main(): |
| 13 | + os.system("clear") |
| 14 | + banner.main() |
| 15 | + banner.attack("Setup") |
| 16 | + os.system("pip install -r requirements.txt") |
| 17 | + os.system("sudo apt install golang -y") |
| 18 | + os.system("go env -w GO111MODULE=on") |
| 19 | + os.system("apt install php") |
| 20 | + create_symlink() |
| 21 | + def create_symlink(): |
| 22 | + proc = subprocess.Popen([f"pwd"], stdout=subprocess.PIPE, shell=True) |
| 23 | + #there keyfor success output and noththere for error output |
| 24 | + (there, notthere) = proc.communicate() |
| 25 | + there=there.decode() |
| 26 | + there=there.split() |
| 27 | + f = open("run.sh", "w") |
| 28 | + f.write("#!/bin/bash") |
| 29 | + f.write("\n") |
| 30 | + f.write(f'cd {there[0]} && python3 cyberonix.py "$@"') |
| 31 | + f.close() |
| 32 | + os.system("chmod +x *") |
| 33 | + os.system("sudo mv run.sh /usr/bin/cyberonix") |
| 34 | + os.system("sudo mv cyberonix.1 /usr/local/man/man1/") |
| 35 | + finish() |
| 36 | + def finish(): |
| 37 | + os.system("clear") |
| 38 | + banner.main() |
| 39 | + banner.attack("Setup Completed") |
| 40 | + try: |
| 41 | + subprocess.run('cyberonix',shell=True, check = True) |
| 42 | + except Exception as err: |
| 43 | + os.system("python3 cyberonix.py") |
| 44 | + exit() |
| 45 | + if __name__ == "__main__": |
| 46 | + main() |
| 47 | +except KeyboardInterrupt: |
| 48 | + exit_program() |
| 49 | +except Exception as err: |
31 | 50 | os.system("clear") |
32 | 51 | banner.main() |
33 | | - banner.attack("Setup Completed") |
34 | | - try: |
35 | | - subprocess.run('cyberonix',shell=True, check = True) |
36 | | - except Exception as err: |
37 | | - os.system("python3 cyberonix.py") |
38 | | - exit() |
| 52 | + banner.attack(f"{colors.red}ERROR{colors.reset}") |
| 53 | + banner.description(f"{colors.red}{err}{colors.reset}") |
| 54 | + |
39 | 55 |
|
40 | | -if __name__ == "__main__": |
41 | | - main() |
42 | 56 |
|
0 commit comments