s4
changeset 563:7ab2ceb1b8dd
$DISABLED controls password disabling
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 14 Apr 2019 21:15:45 +0900 |
parents | 3b5561ea2117 |
children | b86a82ffe407 |
files | scripts/add-user-csv.sh |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line diff
1.1 --- a/scripts/add-user-csv.sh Sun Apr 14 15:33:21 2019 +0900 1.2 +++ b/scripts/add-user-csv.sh Sun Apr 14 21:15:45 2019 +0900 1.3 @@ -5,11 +5,13 @@ 1.4 Usage: ./add-user-csv.sh CSVfile >&2 1.5 Csv file should be the form of: 1.6 username(email),notify-email,gecos,IniPassword 1.7 + Set $DISABLED for setting disabled password 1.8 EOF 1.9 exit 1 1.10 fi 1.11 1.12 target=$(cd `dirname "$1"`; pwd)/`basename $1` 1.13 +encp=${DISABLED:+DisabledPassword} 1.14 1.15 cd `dirname $0`/.. 1.16 if ! . ./s4-funcs.sh; then 1.17 @@ -28,7 +30,7 @@ 1.18 EOF 1.19 while IFS=, read user email gecos inipswd 1.20 do 1.21 - encpswd=`mycrypt "$inipswd" 'StOpmE'` 1.22 + encpswd=${encp:-`mycrypt "$inipswd" 'StOpmE'`} 1.23 case "$user" in 1.24 *\'*) echo "Skipping [$user]" 1.25 continue ;;