projects
/
grml-autoconfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update random password code
[grml-autoconfig.git]
/
autoconfig.functions
diff --git
a/autoconfig.functions
b/autoconfig.functions
index
debf31f
..
5751634
100755
(executable)
--- a/
autoconfig.functions
+++ b/
autoconfig.functions
@@
-1346,7
+1346,11
@@
if checkbootparam ssh ; then
einfo "Bootoption ssh found, trying to set password for user grml."
eindent
if [ -z "$SSH_PASSWD" ] ; then
einfo "Bootoption ssh found, trying to set password for user grml."
eindent
if [ -z "$SSH_PASSWD" ] ; then
- if [ -x /usr/bin/pwgen ] ; then
+ if [ -x /usr/bin/apg ] ; then
+ SSH_PASSWD="$(apg -M NL -a 0 -m 8 -x 12 -n 1)"
+ elif [ -x /usr/bin/gpw ] ; then
+ SSH_PASSWD="$(gpw 1)"
+ elif [ -x /usr/bin/pwgen ] ; then
SSH_PASSWD="$(pwgen -1 8)"
elif [ -x /usr/bin/hexdump ] ; then
SSH_PASSWD="$(dd if=/dev/urandom bs=14 count=1 2>/dev/null | hexdump | awk '{print $3 $4}')"
SSH_PASSWD="$(pwgen -1 8)"
elif [ -x /usr/bin/hexdump ] ; then
SSH_PASSWD="$(dd if=/dev/urandom bs=14 count=1 2>/dev/null | hexdump | awk '{print $3 $4}')"