diff options
author | jonoterc <jon_obuchowski@terc.edu> | 2013-10-10 17:23:18 -0400 |
---|---|---|
committer | Adam Jahn <ajjahn@gmail.com> | 2014-01-10 18:14:45 -0500 |
commit | 699437673e6d17ba7d444d4916d93e40a2df0022 (patch) | |
tree | 9d0eea0ab4edaaec1927f54ce35317b25f8d4b54 /templates | |
parent | e3421d568c4e7d5ace1b5659a8526bfd601eb131 (diff) | |
download | puppet-samba-699437673e6d17ba7d444d4916d93e40a2df0022.tar.gz puppet-samba-699437673e6d17ba7d444d4916d93e40a2df0022.tar.bz2 |
adding shell script for creating a new smb account
will be leveraged by a puppet class; only tested against Ubuntu 12.04
Diffstat (limited to 'templates')
-rw-r--r-- | templates/add_samba_user | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/templates/add_samba_user b/templates/add_samba_user new file mode 100644 index 0000000..1385d4e --- /dev/null +++ b/templates/add_samba_user @@ -0,0 +1,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 |