]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/randpass
b233e24efcea7a9a049a7722ba27a030c28b8aa4
[bacula/bacula] / bacula / autoconf / randpass
1 #! /bin/sh
2 #
3 #   Generate a random password, written to standard output
4 #   By John Walker
5 #
6 if test "x$1" = "x" ; then
7    PWL=48      # Password length in characters
8 else
9    PWL=$1
10 fi 
11 tmp=/tmp/p.tmp.$$    
12 cp autoconf/randpass.bc $tmp
13 ps | sum | tr -d ':[:alpha:] ' | sed 's/^/k=/' >>$tmp
14 date | tr -d ':[:alpha:] ' | sed 's/^/k=k*/' >>$tmp
15 ls -l /tmp | sum | tr -d ':[:alpha:] ' | sed 's/^/k=k*/' >>$tmp
16 echo "j=s(k); for (i = 0; i < $PWL; i++) r()" >>$tmp
17 echo "quit" >>$tmp
18 bc $tmp | awk -f autoconf/randpass.awk
19 rm $tmp