samba/samba-mkhomedir.sh
Silvan Calarco 690f4a096f update to 3.6.23
x86_64: install cups backend under %{_prefix}/lib/cups, not %{_libdir}/cups
x86_64: install pam and nss libraries under /lib64 instead of /lib
use patch to fix smbd link against libtirpc instead of passing LDFLAGS [release 3.6.23-1mamba;Wed Apr 02 2014]
2024-01-05 17:37:14 +01:00

35 lines
797 B
Bash

#!/bin/sh
# mkhomedir.sh -- automatically create user homedirs for Samba DC users
# Copyright (C) 2005 Silvan Calarco <silvan.calarco@qilinux.it>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.
#
# me=${0##*/}
[ "$1" ] || {
echo "Usage: $0 <user>"
exit 1;
}
getent passwd $1 >/dev/null || {
echo "Error: user $1 does not exits. Exiting."
exit 1;
}
[ -e "/home" ] || {
echo "Error: directory /home does not exits. Exiting."
exit 1;
}
HOMEUSER=$1
HOMEDIR=/home/$1
[ -e "$HOMEDIR" ] && exit 0;
cp -a /etc/skel $HOMEDIR
chown -R "$HOMEUSER":"Domain Users" $HOMEDIR