This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if ran with root permissions | |
if [ `id -u` -ne 0 ]; then | |
printf "The script must be run as root! (you can use sudo)\n" | |
exit 1 | |
fi | |
function arrayContains { | |
local e match="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//generates a random password of length minimum 8 | |
//contains at least one lower case letter, one upper case letter, | |
// one number and one special character, | |
//not including ambiguous characters like iIl|1 0oO | |
function randomPassword($len = 8) { | |
//enforce min length 8 | |
if($len < 8) | |
$len = 8; |