mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Add a interactive configuration installer
This commit is contained in:
@ -160,12 +160,12 @@ if __name__ == '__main__':
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if args.install:
|
if args.install:
|
||||||
pwn_check = input("This will create a new configuration file and backup your current one, are you sure? [y/n]")
|
|
||||||
if pwn_check.lower() in ('y', 'yes'):
|
|
||||||
pwn_restore = input("Do you want to restore the previous configuration? [y/n]")
|
pwn_restore = input("Do you want to restore the previous configuration? [y/n]")
|
||||||
if pwn_restore in ('y', 'yes'):
|
if pwn_restore in ('y', 'yes'):
|
||||||
os.system("mv -f /etc/pwnagotchi/config.toml.bak /etc/pwnagotchi/config.toml")
|
os.system("mv -f /etc/pwnagotchi/config.toml.bak /etc/pwnagotchi/config.toml")
|
||||||
else:
|
else:
|
||||||
|
pwn_check = input("This will create a new configuration file and backup your current one, are you sure? [y/n]")
|
||||||
|
if pwn_check.lower() in ('y', 'yes'):
|
||||||
os.system("mv -f /etc/pwnagotchi/config.toml /etc/pwnagotchi/config.toml.bak")
|
os.system("mv -f /etc/pwnagotchi/config.toml /etc/pwnagotchi/config.toml.bak")
|
||||||
with open("/etc/pwnagotchi/config.toml", "a+") as f:
|
with open("/etc/pwnagotchi/config.toml", "a+") as f:
|
||||||
# Set pwnagotchi name
|
# Set pwnagotchi name
|
||||||
@ -222,6 +222,8 @@ if __name__ == '__main__':
|
|||||||
print("Your configuration is done, and I will restart in 5 seconds.")
|
print("Your configuration is done, and I will restart in 5 seconds.")
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
os.system("service pwnagotchi restart")
|
os.system("service pwnagotchi restart")
|
||||||
|
else:
|
||||||
|
print("Ok, doing nothing.")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if args.donate:
|
if args.donate:
|
||||||
|
Reference in New Issue
Block a user