From e26387bb4caa823c83db9e6af1cb415eac88dbab Mon Sep 17 00:00:00 2001 From: sose Date: Tue, 25 Sep 2018 20:30:12 +0200 Subject: [PATCH] Fixed a silly bug --- deluser.sh | 2 +- newuser.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deluser.sh b/deluser.sh index b9cf7dd..1687dcd 100755 --- a/deluser.sh +++ b/deluser.sh @@ -1,7 +1,7 @@ #!/bin/sh SLBRUSER=$1 test -z "$SLBRUSER" && echo "no user provided" && exit -grep -qv "$SLBRUSER" users.txt && echo "user not found in users.txt, will not delete" && exit +grep -qvx "$SLBRUSER" users.txt && echo "user not found in users.txt, will not delete" && exit if ps -o stat= -p $PPID | grep -qv S+ #check if this is being called from listen.py then diff --git a/newuser.sh b/newuser.sh index a40eecf..6bb1779 100755 --- a/newuser.sh +++ b/newuser.sh @@ -5,7 +5,7 @@ test -z "$SLBRUSER" && echo "no user provided" && exit test -z "$PUBKEY" && echo "no key provided" && exit PUBKEY="$(cat "$PUBKEY")" -cut -d: -f1 /etc/passwd | grep -q "$SLBRUSER" && echo "user already exists" && exit +cut -d: -f1 /etc/passwd | grep -qx "$SLBRUSER" && echo "user already exists" && exit echo "Creating homedir..." mkdir "/home/slbr/$SLBRUSER"