edge004-base0.2.1
Corrected the NetSock and made the install script compliant
This commit is contained in:
26
install.py
26
install.py
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
Install script for the Python jailer.
|
||||
Version: 0.2.0-alpha2
|
||||
Version: 0.3.0-main1
|
||||
"""
|
||||
import os
|
||||
import shutil
|
||||
@@ -68,7 +68,7 @@ if setup_posix.lower() == "y":
|
||||
with open("./proc/kcore", "a+") as f:
|
||||
f.write("/sys/jail_mgr.py")
|
||||
f.close()
|
||||
else:
|
||||
else: # POSIX and NO-POSIX have a firm split now.
|
||||
print("Creating directories...")
|
||||
os.mkdir("./bin")
|
||||
os.mkdir("./sys")
|
||||
@@ -77,9 +77,25 @@ else:
|
||||
os.mkdir(f"./home/{usrname}")
|
||||
os.mkdir("./sys/krnl/")
|
||||
print("Copying files...")
|
||||
shutil.move("./main.py", "./sys/jail_mgr.py")
|
||||
shutil.move("./sh.py", "./bin/shell.py")
|
||||
shutil.move("./ledit.py", "./bin/ledit.py")
|
||||
try:
|
||||
shutil.move("./nps/main.py", "./sys/jail_mgr.py")
|
||||
shutil.move("./nps/sh.py", "./bin/shell.py")
|
||||
shutil.move("./nps/ledit.py", "./bin/ledit.py")
|
||||
except Exception as e:
|
||||
print("Failure to install! Non-POSIX files are most likely not present! Aborting install...")
|
||||
shutil.move("../main.py", "../runner.py")
|
||||
shutil.move("./main.py", "../main.py")
|
||||
shutil.move("./sh.py", "../sh.py")
|
||||
shutil.move("./ledit.py", "../ledit.py")
|
||||
os.rmdir("./bin")
|
||||
os.rmdir("./sys/krnl/")
|
||||
os.rmdir("./sys")
|
||||
os.rmdir("./usr")
|
||||
os.rmdir("./proc")
|
||||
os.rmdir(f"./home/{usrname}")
|
||||
os.chdir("../")
|
||||
shutil.rmtree("./vfs/")
|
||||
exit(-1)
|
||||
print("Creating system configuration files...")
|
||||
with open("./sys/usr.conf", "a+") as f:
|
||||
f.write(usrname)
|
||||
|
Reference in New Issue
Block a user