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"