Commit ed143188 authored by Andrew Lee's avatar Andrew Lee

Handle delete accounts/group according to...

Handle delete accounts/group according to https://wiki.debian.org/AccountHandlingInMaintainerScripts .
Signed-off-by: Andrew Lee's avatarAndrew Lee (李健秋) <ajqlee@debian.org>
parent 770124ec
......@@ -12,10 +12,17 @@ if [ "$1" = "purge" ]; then
rmdir /srv/obs 2>/dev/null || true
# Delete obs users and group
deluser --system --quiet obsrun
deluser --system --quiet obsservicerun
if getent group obsrun >/dev/null; then
delgroup --system --quiet obsrun
for USERNAME in obsrun obsservicerun; do
if [ -x "$(command -v deluser)" ]; then
deluser --quiet --system $USERNAME > /dev/null || true
else
echo >&2 "not removing $USERNAME system account because deluser command was not found"
fi
done
if [ -x "$(command -v delgroup)" ]; then
delgroup --quiet --system obsrun > /dev/null || true
else
echo >&2 "not removing obsrun system group because delgroup command was not found"
fi
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment