Add Pass-Generator.sh
This commit is contained in:
parent
35ed08fadc
commit
b3f7d18ce1
1 changed files with 19 additions and 0 deletions
19
Pass-Generator.sh
Normal file
19
Pass-Generator.sh
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Declaration de la fonction de generation
|
||||||
|
function generate() {
|
||||||
|
</dev/urandom tr -dc '!@#$%&*|<>~()_A-Z-a-z-0-9'| fold -w$nb | head -5
|
||||||
|
}
|
||||||
|
|
||||||
|
# Demande a l utilisateur le nombre de caratere, par défaut 20
|
||||||
|
read -p "Nombre de caractère (defaut 20)? " nb
|
||||||
|
|
||||||
|
if [ "$nb" = "" ];
|
||||||
|
then
|
||||||
|
nb=20;
|
||||||
|
else
|
||||||
|
generate
|
||||||
|
fi
|
||||||
|
|
||||||
|
generate
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue