correction dau.sh , marche
This commit is contained in:
parent
6e7a12f55b
commit
4bcc3b86fd
@ -1,11 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
#check si il y a un argument et exit 1 si y'a pas
|
#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"
|
echo "Usage : $0 user >> /var/www/html/dokuwiki/conf/users.auth.php"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# chiffremment du mot de passe $1 avec bcrypt
|
# chiffremment du mot de passe $1 avec bcrypt
|
||||||
hashpass=$(htpasswd -bnBC 10 "" $1|tr -d '/d')
|
hashpass=$(htpasswd -bnBC 10 "" "${1}"|tr -d '\d')
|
||||||
echo "${1}${hashpass}:${1}:${1}@localhost:${1},user"
|
echo "${1}${hashpass}:${1}:${1}@localhost:${1},user"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user