2 Commits
v0.7 ... v0.9

Author SHA1 Message Date
4bcc3b86fd correction dau.sh , marche 2022-03-31 08:41:07 +02:00
6e7a12f55b correction dau.sh 2022-03-24 11:55:43 +01:00

View File

@ -1,12 +1,13 @@
#!/bin/bash
set -e
set -u
#check si il y a un argument et exit 1 si y'a pas
if [ ! $1 ] ; then
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
hashpass=$(htpasswd -bnBC 10 "" "${1}"|tr -d '\d')
echo "${1}${hashpass}:${1}:${1}@localhost:${1},user"