Fixed issues in rspamd script

This commit is contained in:
Antoine Nguyen
2023-09-14 10:10:07 +02:00
parent 0b85e2c7ef
commit 92864aa288
3 changed files with 34 additions and 18 deletions

View File

@@ -103,6 +103,17 @@ def dist_name():
return dist_info()[0].lower()
def is_dist_debian_based() -> (bool, str):
"""Check if current OS is Debian based or not."""
status, codename = exec_cmd("lsb_release -c -s")
codename = codename.lower()
return codename in [
"bionic", "bookworm", "bullseye", "buster",
"focal", "jammy", "jessie", "sid", "stretch",
"trusty", "wheezy", "xenial"
], codename
def mkdir(path, mode, uid, gid):
"""Create a directory."""
if not os.path.exists(path):