mirror of
https://github.com/unpoller/unpoller.git
synced 2026-10-18 22:40:03 +02:00
ensure user is setup in preinstall hook
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
OS="$(uname -s)"
|
||||
|
||||
if [ "${OS}" = "Linux" ]; then
|
||||
# Make a user and group for this app, but only if it does not already exist.
|
||||
id unpoller >/dev/null 2>&1 || \
|
||||
useradd --system --user-group --no-create-home --home-dir /tmp --shell /bin/false unpoller
|
||||
elif [ "${OS}" = "OpenBSD" ]; then
|
||||
id unpoller >/dev/null 2>&1 || \
|
||||
useradd -g =uid -d /tmp -s /bin/false unpoller
|
||||
elif [ "${OS}" = "FreeBSD" ]; then
|
||||
id unpoller >/dev/null 2>&1 || \
|
||||
pw useradd unpoller -d /tmp -w no -s /bin/false
|
||||
else
|
||||
echo "Unknown OS: ${OS}, please add system user unpoller manually."
|
||||
fi
|
||||
Reference in New Issue
Block a user