mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Update setup.py to look for empty apt_packages.txt
Signed-off-by: jayofelony <oudshoorn.jeroen@gmail.com>
This commit is contained in:
7
setup.py
7
setup.py
@ -34,8 +34,9 @@ def install_file(source_filename, dest_filename):
|
|||||||
|
|
||||||
|
|
||||||
def install_system_files():
|
def install_system_files():
|
||||||
|
data_path = None
|
||||||
|
if os.stat("apt_packages.txt").st_size != 0:
|
||||||
f = open("apt_packages.txt", "r")
|
f = open("apt_packages.txt", "r")
|
||||||
|
|
||||||
for x in f:
|
for x in f:
|
||||||
os.system(f"apt-get install -y {x}")
|
os.system(f"apt-get install -y {x}")
|
||||||
f.close()
|
f.close()
|
||||||
@ -63,9 +64,7 @@ class CustomInstall(install):
|
|||||||
def run(self):
|
def run(self):
|
||||||
super().run()
|
super().run()
|
||||||
if os.geteuid() != 0:
|
if os.geteuid() != 0:
|
||||||
warnings.warn(
|
warnings.warn("Not running as root, can't install pwnagotchi system files!")
|
||||||
"Not running as root, can't install pwnagotchi system files!"
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
install_system_files()
|
install_system_files()
|
||||||
restart_services()
|
restart_services()
|
||||||
|
Reference in New Issue
Block a user