aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat
-rw-r--r--pkg/scripts/postinstall.sh17+12 −5
-rw-r--r--pkg/scripts/preremove.sh6+4 −2
2 files changed, 16 insertions, 7 deletions
diff --git a/pkg/scripts/postinstall.sh b/pkg/scripts/postinstall.sh
index f6f2c15..2373a73 100644
--- a/pkg/scripts/postinstall.sh
+++ b/pkg/scripts/postinstall.sh
@@ -4,12 +4,19 @@
set -e
-if ! getent group zorian >/dev/null; then
- groupadd --system zorian
+PROGRAM=zorian
+ZORIAN_USER=${ZORIAN_USER:-zorian}
+ZORIAN_GROUP=${ZORIAN_GROUP:-${ZORIAN_USER}}
+
+if ! getent group $ZORIAN_GROUP >/dev/null; then
+ groupadd --system $ZORIAN_GROUP
fi
-if ! getent passwd zorian >/dev/null; then
- useradd --system --gid zorian --no-create-home --shell /usr/sbin/nologin zorian
+if ! getent passwd $ZORIAN_USER >/dev/null; then
+ useradd --system --gid $ZORIAN_GROUP --no-create-home --shell /usr/sbin/nologin $ZORIAN_USER
fi
-systemctl daemon-reload
+if [ -x "/bin/systemctl" ] && [ -d /run/systemd/system ] && [ -f /usr/lib/systemd/system/zorian.service ]; then
+ /bin/systemctl daemon-reload
+ /bin/systemctl enable zorian
+fi
diff --git a/pkg/scripts/preremove.sh b/pkg/scripts/preremove.sh
index 9236820..87c062a 100644
--- a/pkg/scripts/preremove.sh
+++ b/pkg/scripts/preremove.sh
@@ -4,5 +4,7 @@
set -e
-systemctl stop zorian.service || true
-systemctl disable zorian.service || true
+if [ -x "/bin/systemctl" ] && [ -d /run/systemd/system ] && [ -f /usr/lib/systemd/system/zorian.service ]; then
+ /bin/systemctl stop zorian.service || true
+ /bin/systemctl disable zorian.service || true
+fi