Fixed a silly bug

This commit is contained in:
sose 2018-09-25 20:30:12 +02:00
parent 8669f5f8aa
commit e26387bb4c
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
SLBRUSER=$1 SLBRUSER=$1
test -z "$SLBRUSER" && echo "no user provided" && exit 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 if ps -o stat= -p $PPID | grep -qv S+ #check if this is being called from listen.py
then then

View File

@ -5,7 +5,7 @@ test -z "$SLBRUSER" && echo "no user provided" && exit
test -z "$PUBKEY" && echo "no key provided" && exit test -z "$PUBKEY" && echo "no key provided" && exit
PUBKEY="$(cat "$PUBKEY")" 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..." echo "Creating homedir..."
mkdir "/home/slbr/$SLBRUSER" mkdir "/home/slbr/$SLBRUSER"