mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-22 13:34:55 +01:00
Fix for restore config
- removed hardcoding of user/group from pi:pi - retrieve owner / group of oroginal folder and use them
This commit is contained in:
parent
6f60b7ae7c
commit
20e6aa7e59
2 changed files with 5 additions and 3 deletions
|
@ -1,2 +1,2 @@
|
|||
__version__ = "4.0.1.a11"
|
||||
__version__ = "4.0.1.1"
|
||||
|
||||
|
|
|
@ -152,12 +152,14 @@ def check_for_setup():
|
|||
if zip_content == True:
|
||||
print("Found correct content. Starting Restore process")
|
||||
output_path = pathlib.Path(os.path.join(".", 'config'))
|
||||
owner = output_path.owner()
|
||||
group = output_path.group()
|
||||
print("Removing old config folder")
|
||||
shutil.rmtree(output_path, ignore_errors=True)
|
||||
print("Extracting zip file to config folder")
|
||||
zip.extractall(output_path)
|
||||
print("Changing owner and group of config folder recursively to pi:pi")
|
||||
recursive_chown(output_path, "pi", "pi")
|
||||
print("Changing owner and group of config folder recursively to {}:{}".format(owner,group))
|
||||
recursive_chown(output_path, owner, group)
|
||||
print("Removing backup file")
|
||||
os.remove(backupfile)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue