2021-12-07 13:23:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
DISTRO=$(lsb_release -si)
|
|
|
|
if ! id -u nimbus > /dev/null 2>&1; then
|
|
|
|
case $DISTRO in
|
|
|
|
Ubuntu|Debian)
|
2022-08-17 10:26:31 +00:00
|
|
|
# Debian uses `adduser` to create user...
|
2021-12-07 13:23:57 +00:00
|
|
|
adduser --system --no-create-home --group nimbus
|
|
|
|
;;
|
2022-08-17 10:26:31 +00:00
|
|
|
*)
|
|
|
|
# ... while `useradd` is more standard
|
|
|
|
useradd --system --no-create-home --user-group nimbus
|
2021-12-07 13:23:57 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p /var/lib/nimbus
|
|
|
|
chown nimbus:nimbus /var/lib/nimbus
|
|
|
|
|
|
|
|
systemctl daemon-reload
|