misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
5f4ee26f99
commit
22afb563e3
@ -36,13 +36,15 @@ def load_config(args):
|
|||||||
# logging not configured here yet
|
# logging not configured here yet
|
||||||
print("installing /boot/config.yml to %s ...", args.user_config)
|
print("installing /boot/config.yml to %s ...", args.user_config)
|
||||||
# https://stackoverflow.com/questions/42392600/oserror-errno-18-invalid-cross-device-link
|
# https://stackoverflow.com/questions/42392600/oserror-errno-18-invalid-cross-device-link
|
||||||
shutil.rmtree('/etc/pwnagotchi', ignore_errors=True)
|
shutil.move("/boot/config.yml", args.user_config)
|
||||||
shutil.move('/boot/pwnagotchi', '/etc/', args.user_config)
|
|
||||||
|
|
||||||
|
# check for an entire pwnagotchi folder on /boot/
|
||||||
if os.path.isdir('/boot/pwnagotchi'):
|
if os.path.isdir('/boot/pwnagotchi'):
|
||||||
print("installing /boot/pwnagotchi to /etc/pwnagotchi ...")
|
print("installing /boot/pwnagotchi to /etc/pwnagotchi ...")
|
||||||
|
shutil.rmtree('/etc/pwnagotchi', ignore_errors=True)
|
||||||
|
shutil.move('/boot/pwnagotchi', '/etc/')
|
||||||
|
|
||||||
# if no config is found, copy the defaults
|
# if not config is found, copy the defaults
|
||||||
if not os.path.exists(args.config):
|
if not os.path.exists(args.config):
|
||||||
print("copying %s to %s ..." % (ref_defaults_file, args.config))
|
print("copying %s to %s ..." % (ref_defaults_file, args.config))
|
||||||
shutil.copy(ref_defaults_file, args.config)
|
shutil.copy(ref_defaults_file, args.config)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user