mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-03 01:23:49 +00:00
3369145c11
- Use SUB_LIST/SUB_FILES rather than a bunch of seds - Tidy whitespace in pkg-install and pkg-deinstall scripts - Tidy up rc script and improve tests using ps Approved by: clement (mentor)
31 lines
593 B
Bash
31 lines
593 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
|
|
if [ "$2" != "POST-DEINSTALL" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
CLIENTUSER=%%CLIENTUSER%%
|
|
CLIENTGROUP=%%CLIENTGROUP%%
|
|
|
|
if /usr/sbin/pw usershow "$CLIENTUSER" 2>/dev/null 1>&2; then
|
|
if /usr/sbin/pw userdel -n $CLIENTUSER; then
|
|
echo "=> Removed user \"$CLIENTUSER\"."
|
|
else
|
|
echo "=> Removing user \"$CLIENTUSER\" failed."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if /usr/sbin/pw groupshow "$CLIENTGROUP" 2>/dev/null 1>&2; then
|
|
if /usr/sbin/pw groupdel -n $CLIENTGROUP; then
|
|
echo "=> Removed group \"$CLIENTGROUP\"."
|
|
else
|
|
echo "=> Removing group \"$CLIENTGROUP\" failed."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
exit 0
|