summaryrefslogtreecommitdiff
path: root/scripts/uninstall
blob: 9b1b8e7654cced982b0d00682e5b5f8fcf6bdda3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)