mirror of
https://github.com/rlister/dockerfiles.git
synced 2025-12-12 17:26:15 +00:00
15 lines
272 B
Bash
15 lines
272 B
Bash
#!/bin/sh
|
|
|
|
## make sure output dir exists
|
|
dir=$(dirname $OUTPUT)
|
|
if [ ! -d $dir ] ; then
|
|
mkdir -p $dir
|
|
fi
|
|
|
|
## loop user:pass args
|
|
for arg in $* ; do
|
|
user=$(echo ${arg%%:*})
|
|
pass=$(echo ${arg##*:})
|
|
printf "${user}:$(openssl passwd -$CRYPT $pass)\n" >> $OUTPUT
|
|
done
|