Files
unkinben b18e34c905
Build / build-8 (pull_request) Successful in 10s
Build / build-9 (pull_request) Successful in 10s
feat: additional pre-commit checks
- add all precommit checks from pre-commit's hooks repo
- ensure scripts with shebangs are executable
2026-03-07 17:04:48 +11:00

21 lines
547 B
Bash
Executable File

#!/usr/bin/env bash
# Create stalwart user and group
if ! getent group stalwart >/dev/null; then
groupadd -r stalwart
fi
if ! getent passwd stalwart >/dev/null; then
useradd -r -g stalwart -d /opt/stalwart -s /sbin/nologin -c "Stalwart Mail Server" stalwart
fi
# Create required directories
mkdir -p /opt/stalwart/{bin,etc,data,logs}
mkdir -p /var/lib/stalwart
mkdir -p /var/log/stalwart
# Set ownership
chown -R stalwart:stalwart /opt/stalwart
chown -R stalwart:stalwart /var/lib/stalwart
chown -R stalwart:stalwart /var/log/stalwart