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

# This script adds a samba account for a given user and password
# call as:
# > add_samba_user "USERNAME" "PASSWORD"

/bin/echo -e "$2\n$2\n" | sudo /usr/bin/pdbedit -a "$1" -t 1>/dev/null
results=$?

if [ $results = 0 ]; then
	echo "added samba account for '$1'"
else
	echo "could not add samba account for '$1'"
fi

exit $results