From 249d11ccee0bccbd4785794913c44c2eafc2c460 Mon Sep 17 00:00:00 2001
From: xengineering <mail2xengineering@protonmail.com>
Date: Sun, 7 Mar 2021 11:10:38 +0100
Subject: Implement Deployment

---
 scripts/uninstall | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 scripts/uninstall

(limited to 'scripts/uninstall')

diff --git a/scripts/uninstall b/scripts/uninstall
new file mode 100755
index 0000000..9b1b8e7
--- /dev/null
+++ b/scripts/uninstall
@@ -0,0 +1,19 @@
+#!/usr/bin/python3
+# vim: shiftwidth=4 tabstop=4 expandtab
+
+
+import configparser
+import subprocess
+
+
+# read config
+config = configparser.ConfigParser()
+config.read("./src/config.ini")
+cfg = {}
+for option in config.options("web-template"):
+    cfg[option] = config.get("web-template", option)
+
+# uninstall the project
+subprocess.run("rm -rf /opt/{}/".format(cfg["project_name"]), shell=True)
+subprocess.run("rm /etc/systemd/system/{}.service".format(cfg["project_name"]), shell=True)
+
-- 
cgit v1.2.3-70-g09d2