~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to source3/script/updatesmbpasswd.sh

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
nawk 'BEGIN {FS=":"} 
 
3
{
 
4
        if( $0 ~ "^#" ) {
 
5
                print $0
 
6
        } else if( (length($4) == 32) && (($4 ~ "^[0-9A-F]*$") || ($4 ~ "^[X]*$") || ( $4 ~ "^[*]*$"))) {
 
7
                print $0
 
8
        } else {
 
9
                printf( "%s:%s:%s:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:", $1, $2, $3);
 
10
                for(i = 4; i <= NF; i++)
 
11
                        printf("%s:", $i)
 
12
                printf("\n")
 
13
        }
 
14
}'