aboutsummaryrefslogtreecommitdiffstats
path: root/trunk/get-password
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/get-password')
-rwxr-xr-xtrunk/get-password11
1 files changed, 11 insertions, 0 deletions
diff --git a/trunk/get-password b/trunk/get-password
new file mode 100755
index 0000000..caa783a
--- /dev/null
+++ b/trunk/get-password
@@ -0,0 +1,11 @@
+#!/bin/sh
+# $Id$
+# helper script for rpm scriptlets to get a random password
+
+if [ -n "$1" ]; then
+ length=$1
+else
+ length=8
+fi
+
+perl -e "@c = (a..z,A..Z,0..9); print map { @c[rand @c] } 0..$length"