diff options
author | Guillaume Rousse <guillomovitch@mandriva.org> | 2008-01-27 15:13:47 +0000 |
---|---|---|
committer | Guillaume Rousse <guillomovitch@mandriva.org> | 2008-01-27 15:13:47 +0000 |
commit | afb05baf5a5787d7c76b994cc5ab33e2462c8b1a (patch) | |
tree | 7d1ebcd585e8d9f026840f99db269de675d74410 | |
parent | 52e21b9d2cb3e614378500d924c501a7be8bea0b (diff) | |
download | rpm-helper-afb05baf5a5787d7c76b994cc5ab33e2462c8b1a.tar rpm-helper-afb05baf5a5787d7c76b994cc5ab33e2462c8b1a.tar.gz rpm-helper-afb05baf5a5787d7c76b994cc5ab33e2462c8b1a.tar.bz2 rpm-helper-afb05baf5a5787d7c76b994cc5ab33e2462c8b1a.tar.xz rpm-helper-afb05baf5a5787d7c76b994cc5ab33e2462c8b1a.zip |
change create-ssl-certificate interface to use options
-rwxr-xr-x | create-ssl-certificate | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/create-ssl-certificate b/create-ssl-certificate index 784d0e4..0e2e250 100755 --- a/create-ssl-certificate +++ b/create-ssl-certificate @@ -2,17 +2,23 @@ # $Id$ # helper script for creating ssl certificates -if [ $# -lt 3 ]; then - echo "usage: $0 <pkg name> <num installed> <service> <bundle> <group>" 1>&2 +while [ $# -gt 0 ]; do + case $1 in + -g) group=$2; shift 2;; + -b) bundle="true"; shift;; + *) args=( ${args[@]:-} $1 ); shift;; + esac +done + +pkg=${args[0]} # name of the package +num=${args[1]} # number of packages installed +srv=${args[2]} # name of the service + +if [ -z "$pkg" -o -z "$num" -o -z "$srv" ]; then + echo "usage: $0 [-g <group>] [-b] <pkg name> <num installed> <service>" 1>&2 exit 1 fi -pkg=$1 # name of the package -num=$2 # number of packages installed -srv=$3 # name of the service -bundle=$4 # bundle mode -group=$5 # group with read access on key - if [ $num = 1 ]; then # default values host=$(hostname) |