Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
3ba2ed5140 | |||
4bcc3b86fd |
@ -1,11 +1,14 @@
|
|||||||
#!/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" "$1")
|
||||||
echo "${1}${hashpass}:${1}:${1}@localhost:${1},user"
|
|
||||||
|
echo "${hashpass}:${1}:${1}@localhost:${1},user"
|
||||||
|
11
ap23/script/dau2.sh
Executable file
11
ap23/script/dau2.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
|
||||||
|
./dau.sh anthony >> /var/www/html/dokuwiki/conf/users.auth.php
|
||||||
|
./dau.sh rayan >> /var/www/html/dokuwiki/conf/users.auth.php
|
||||||
|
./dau.sh mathis >> /var/www/html/dokuwiki/conf/users.auth.php
|
||||||
|
./dau.sh lucas >> /var/www/html/dokuwiki/conf/users.auth.php
|
||||||
|
./dau.sh adrien >> /var/www/html/dokuwiki/conf/users.auth.php
|
4
ap23/script/users.txt
Normal file
4
ap23/script/users.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
anthony: anthony arnoux
|
||||||
|
mathis: mathis laceppe
|
||||||
|
lucas: lucas seignez
|
||||||
|
rayan: rayan
|
Reference in New Issue
Block a user