1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/source3/script/mknissmbpasswd.sh
Andreas Schneider cb10b8704e s3:script: Reformat shell scripts
shfmt -f source3/script/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Mar  3 01:53:16 UTC 2022 on sn-devel-184
2022-03-03 01:53:16 +00:00

29 lines
700 B
Bash
Executable File

#!/bin/sh
#
# Copyright (C) 1998 Benny Holmgren
#
# Script to import smbpasswd file into the smbpasswd NIS+ table. Reads
# from stdin the smbpasswd file.
#
while true; do
read row
if [ -z "$row" ]; then
break
fi
if [ "$(echo $row | cut -c1)" = "#" ]; then
continue
fi
nistbladm -a \
name=\"$(echo $row | cut -d: -f1)\" \
uid=\"$(echo $row | cut -d: -f2)\" \
lmpwd=\"$(echo $row | cut -d: -f3)\" \
ntpwd=\"$(echo $row | cut -d: -f4)\" \
acb=\"$(echo $row | cut -d: -f5)\" \
pwdlset_t=\"$(echo $row | cut -d: -f6)\" \
gcos=\"$(echo $row | cut -d: -f7)\" \
home=\"$(echo $row | cut -d: -f8)\" \
shell=\"$(echo $row | cut -d: -f9)\" smbpasswd.org_dir.$(nisdefaults -d)
done