#!/bin/bash

#
# A wrapper script for adding Samba machines to LDAP
#
# Authors: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 
#     
# Date:   2011-09-02

set +e

# This script shall always succeed in order not to irritate Samba...
# Most common failure of smbldap-machineadd-gosa is: ,,already exists''
# which may well happen and should be ignored.

/etc/samba/smbldap-machineadd-gosa -t0 -w "$1"
nscd -i passwd
sleep 1
exit 0

