From: Po-Hsu Lin Date: Wed, 22 Nov 2017 08:11:34 +0000 (-0500) Subject: lxc-test-unpriv: check user existence before removing it X-Git-Tag: lxc-3.0.0.beta1~177^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1936%2Fhead;p=thirdparty%2Flxc.git lxc-test-unpriv: check user existence before removing it Check the test user (lxcunpriv) before calling deluser command, otherwise it will print unnecessary error message: /usr/sbin/deluser: The user 'lxcunpriv' does not exist. Signed-off-by: Po-Hsu Lin --- diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv index 97b70e796..16ff12dd7 100755 --- a/src/tests/lxc-test-unpriv +++ b/src/tests/lxc-test-unpriv @@ -105,7 +105,7 @@ fi trap cleanup EXIT SIGHUP SIGINT SIGTERM set -eu -deluser $TUSER && rm -Rf $HDIR || true +id $TUSER &> /dev/null && deluser -q --remove-home $TUSER useradd $TUSER mkdir -p $HDIR