]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/randpass
rpm: Add Fedora26-64 platform
[bacula/bacula] / bacula / autoconf / randpass
1 #! /bin/sh
2 #
3 #   Generate a random password, written to standard output
4 #   By John Walker
5 #
6 LANG=C
7 if test "x$1" = "x" ; then
8    PWL=48      # Password length in characters
9 else
10    PWL=$1
11 fi 
12 tmp=`mktemp randpass.XXXXXXXXXX`
13 if test x$tmp = x; then
14    tmp=/tmp/p.tmp.$$    
15    if test -f $tmp; then
16       echo "Temp file security problem on: $tmp"
17       exit 1
18    fi
19 fi
20 cp autoconf/randpass.bc $tmp
21 ps | sum | tr -d ':[:alpha:] ' | sed 's/^/k=/' >>$tmp
22 date | tr -d ':[:alpha:] ' | sed 's/^/k=k*/' >>$tmp
23 ls -l /tmp | sum | tr -d ':[:alpha:] ' | sed 's/^/k=k*/' >>$tmp
24 echo "j=s(k); for (i = 0; i < $PWL; i++) r()" >>$tmp
25 echo "quit" >>$tmp
26 bc $tmp | awk -f autoconf/randpass.awk
27 rm $tmp