Restore workflow done

This commit is contained in:
Spitap
2022-07-26 12:07:42 +02:00
parent 439ffb94c4
commit 15768c429e
8 changed files with 89 additions and 2 deletions

View File

@@ -46,6 +46,11 @@ class Postwhite(base.Installer):
self.install_from_archive(SPF_TOOLS_REPOSITORY, install_dir)
postw_dir = self.install_from_archive(
POSTWHITE_REPOSITORY, install_dir)
utils.copy_file(os.path.join(postw_dir, "postwhite.conf"), "/etc")
postwhiteBackupConf = self.restore+"custom/postwhite.conf"
if self.restore and os.path.isfile(postwhiteBackupConf):
utils.printcolor("Restoring postwhite.conf backup.", utils.MAGENTA)
utils.copy_file(postwhiteBackupConf, "/etc")
else:
utils.copy_file(os.path.join(postw_dir, "postwhite.conf"), "/etc")
postw_bin = os.path.join(postw_dir, "postwhite")
utils.exec_cmd("{} /etc/postwhite.conf".format(postw_bin))