dos/build.py

20 lines
692 B
Python
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
import os
import sys
import subprocess
log_path = "/var/log/DosAtk"
if not os.path.exists(log_path):
if os.getuid() == 0: # Если уже root
os.system("mkdir -p /var/log && touch /var/log/DosAtk")
os.system("chmod 666 /var/log/DosAtk")
else:
os.system("sudo mkdir -p /var/log && sudo touch /var/log/DosAtk 2>/dev/null || true")
os.system("sudo chmod 666 /var/log/DosAtk 2>/dev/null || true")
# Компиляция
if subprocess.call(["g++", "src/DosAtk.cpp", "-o", "DosAtk", "-lcurl", "-lssl", "-lcrypto"]) != 0:
sys.exit(1)
# Запуск с аргументами
os.execvp("./DosAtk", ["./DosAtk"] + sys.argv[1:])