7 update-rc.d metaproxy remove >/dev/null
9 # copy of metaproxy.user, which is gone at this point
10 SERVER_HOME=/var/metaproxy
12 SERVER_NAME="Metaproxy user"
13 SERVER_GROUP=metaproxy
15 # find first and last SYSTEM_UID numbers
16 for LINE in `grep SYSTEM_UID /etc/adduser.conf | grep -v "^#"`; do
19 FIRST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='`
22 LAST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='`
28 # Remove system account if necessary
29 CREATEDUSER=$SERVER_USER
30 if [ -n "$FIRST_SYSTEM_UID" ] && [ -n "$LAST_SYSTEM_UID" ]; then
31 if USERID=`getent passwd $CREATEDUSER | cut -f 3 -d ':'`; then
32 if [ -n "$USERID" ]; then
33 if [ "$FIRST_SYSTEM_UID" -le "$USERID" ] && \
34 [ "$USERID" -le "$LAST_SYSTEM_UID" ]; then
35 echo -n "Removing $CREATEDUSER system user.."
36 deluser --quiet $CREATEDUSER || true
42 # Remove system group if necessary
43 CREATEDGROUP=$SERVER_GROUP
44 FIRST_USER_GID=`grep ^USERS_GID /etc/adduser.conf | cut -f2 -d '='`
45 if [ -n "$FIRST_USER_GID" ]; then
46 if GROUPGID=`getent group $CREATEDGROUP | cut -f 3 -d ':'`; then
47 if [ -n "$GROUPGID" ]; then
48 if [ "$FIRST_USER_GID" -gt "$GROUPGID" ]; then
49 echo -n "Removing $CREATEDGROUP group.."
50 delgroup --only-if-empty $CREATEDGROUP || true