aboutsummaryrefslogtreecommitdiff
path: root/templates/check_samba_user
blob: 431c3c4f1ddf2efb99886706d70b2e2f4ad6d0cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

# This script checks to see if a given user account exists on samba
# if so, it returns 0
# otherwise it returns 1

sudo /usr/bin/pdbedit -L | egrep -q "^$1:"
exists=$?

if [ $exists = 0 ]; then
	echo "'$1' is a samba user"
else
	echo "no samba account matching '$1'"
fi

exit $exists