aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2007-02-15 15:10:39 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2007-02-15 15:10:39 +0000
commitb6be6092d4c8dc13ba019da78d082965a64bd925 (patch)
treef0626220ac35c97ea211fd024bc0033607a02dca
parentc6a1eebad47861794b33e89b64044217c5e1f176 (diff)
downloadrpm-helper-b6be6092d4c8dc13ba019da78d082965a64bd925.tar
rpm-helper-b6be6092d4c8dc13ba019da78d082965a64bd925.tar.gz
rpm-helper-b6be6092d4c8dc13ba019da78d082965a64bd925.tar.bz2
rpm-helper-b6be6092d4c8dc13ba019da78d082965a64bd925.tar.xz
rpm-helper-b6be6092d4c8dc13ba019da78d082965a64bd925.zip
get-password script
-rwxr-xr-xget-password21
-rw-r--r--rpm-helper.macros.in4
2 files changed, 25 insertions, 0 deletions
diff --git a/get-password b/get-password
new file mode 100755
index 0000000..27cca4d
--- /dev/null
+++ b/get-password
@@ -0,0 +1,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
diff --git a/rpm-helper.macros.in b/rpm-helper.macros.in
index b33de40..37e7d7e 100644
--- a/rpm-helper.macros.in
+++ b/rpm-helper.macros.in
@@ -1,5 +1,9 @@
# $Id$
+%_get_password_helper @LIBDIR@/get-password
+%get_password() %_get_password_helper %{1} \
+%{nil}
+
%_create_ghostfile_helper @LIBDIR@/create-file
%create_ghostfile() %_create_ghostfile_helper %{name} $1 %{1} %{2} %{3} %{4} \
%{nil}