13 lines
307 B
Bash
Executable File
13 lines
307 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#check si il y a un argument et exit 1 si y'a pas
|
|
if [ ! $1 ] ; then
|
|
echo "Usage : $0 user >> /var/www/html/dokuwiki/conf/users.auth.php"
|
|
exit 1
|
|
fi
|
|
|
|
# chiffremment du mot de passe $1 avec bcrypt
|
|
hashpass=$(htpasswd -bnBC 10 "" $1|tr -d '/d')
|
|
bon=$1$hashpass:$1:$1@localhost:$1,user
|
|
echo $bon
|