aboutsummaryrefslogtreecommitdiffstats
path: root/get-password
blob: 27cca4dc2a3580af9b25903b79df577de7b231f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
#---------------------------------------------------------------
# Project         : Mandrake Linux
# Module          : rpm-helper
# File            : get-password
# Version         : $Id: del-user,v 1.1.1.1 2002/07/09 15:04:21 flepied Exp $
# Author          : Guillaume Rousse
# Created On      : Thu Apr  1 00:00:46 2004
# Purpose         : helper script for rpm scriptlets to generate
#		    a random password
#---------------------------------------------------------------

if [ -n "$1" ]; then
    length=$1
else
    length=8
fi

perl -e "print map { (a..z,A..Z,0..9)[rand 62] } 0..$length"

# get-password ends here