DKIM keys restore, Radicale backup/restore, fixes

This commit is contained in:
Spitap
2022-10-25 16:58:57 +02:00
parent 4c1f8710b5
commit 5c9d5c9a03
8 changed files with 62 additions and 22 deletions

View File

@@ -47,13 +47,15 @@ class Postwhite(base.Installer):
self.install_from_archive(SPF_TOOLS_REPOSITORY, install_dir)
postw_dir = self.install_from_archive(
POSTWHITE_REPOSITORY, install_dir)
postwhite_backup_configuration = os.path.join(
self.restore, "custom/postwhite.conf")
if self.restore and os.path.isfile(postwhite_backup_configuration):
utils.copy_file(postwhite_backup_configuration, "/etc")
utils.printcolor(
"postwhite.conf restored from backup", utils.GREEN)
else:
utils.copy_file(os.path.join(postw_dir, "postwhite.conf"), "/etc")
# Attempt to restore config file from backup
if self.restore is not None:
postwhite_backup_configuration = os.path.join(
self.restore, "custom/postwhite.conf")
if os.path.isfile(postwhite_backup_configuration):
utils.copy_file(postwhite_backup_configuration, self.config_dir)
utils.printcolor(
"postwhite.conf restored from backup", utils.GREEN)
else:
utils.copy_file(os.path.join(postw_dir, "postwhite.conf"), self.config_dir)
postw_bin = os.path.join(postw_dir, "postwhite")
utils.exec_cmd("{} /etc/postwhite.conf".format(postw_bin))