Add bash configuration files

This commit is contained in:
xavier
2013-04-24 16:58:31 +02:00
parent 1849cd96a2
commit 9fad99b12f
30 changed files with 570 additions and 0 deletions

17
libs/password.bash Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
encpasswd() {
local password_clear=$1
local password_md5hash=$(openssl passwd -1 $password_clear)
echo "Password : $password_clear"
echo "MD5HASH : $password_md5hash"
}
genpasswd() {
local l=$1
[ "$l" == "" ] && l=12
local password_clear=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs)
local password_md5hash=$(openssl passwd -1 $password_clear)
echo "Password : $password_clear"
echo "MD5HASH : $password_md5hash"
}