File: mknissmbpasswd.sh

package info (click to toggle)
samba-doc-ja 2.2.8a%2Bja1.0-0.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 34,192 kB
  • ctags: 22,693
  • sloc: ansic: 197,587; sh: 8,073; perl: 5,377; makefile: 1,489; awk: 1,146; exp: 1,143; csh: 216
file content (31 lines) | stat: -rwxr-xr-x 719 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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