summaryrefslogtreecommitdiffstats
path: root/pki/scripts
diff options
context:
space:
mode:
authormharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2011-07-15 00:14:33 +0000
committermharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2011-07-15 00:14:33 +0000
commit56c140612731940690a1f5a6992977b3fed01cd6 (patch)
tree9fc69c5790308f4af258bf830f9990def77489ea /pki/scripts
parent7db47ec57c27ea82aaff61922040007f205a06cc (diff)
downloadpki-56c140612731940690a1f5a6992977b3fed01cd6.tar.gz
pki-56c140612731940690a1f5a6992977b3fed01cd6.tar.xz
pki-56c140612731940690a1f5a6992977b3fed01cd6.zip
Bugzilla Bug #690950 - Update Dogtag Packages for Fedora 15
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@2058 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/scripts')
-rwxr-xr-xpki/scripts/build_dogtag_pki217
-rwxr-xr-xpki/scripts/compose_dogtag_pki_theme_packages2
-rwxr-xr-xpki/scripts/compose_ipa_pki_theme_packages2
-rwxr-xr-xpki/scripts/compose_pki_console_packages2
-rwxr-xr-xpki/scripts/compose_pki_core_packages2
-rwxr-xr-xpki/scripts/compose_pki_kra_packages2
-rwxr-xr-xpki/scripts/compose_pki_migrate_packages2
-rwxr-xr-xpki/scripts/compose_pki_ocsp_packages2
-rwxr-xr-xpki/scripts/compose_pki_ra_packages2
-rwxr-xr-xpki/scripts/compose_pki_tks_packages2
-rwxr-xr-xpki/scripts/compose_pki_tps_packages2
-rwxr-xr-xpki/scripts/create_pki_yum_repos78
-rwxr-xr-xpki/scripts/install_default_ca_instance56
-rwxr-xr-xpki/scripts/install_default_pki_instances122
-rwxr-xr-xpki/scripts/prepare_pki189
-rwxr-xr-xpki/scripts/remove_default_pki_instances115
-rwxr-xr-xpki/scripts/remove_pki_components157
17 files changed, 944 insertions, 10 deletions
diff --git a/pki/scripts/build_dogtag_pki b/pki/scripts/build_dogtag_pki
new file mode 100755
index 000000000..9673b9478
--- /dev/null
+++ b/pki/scripts/build_dogtag_pki
@@ -0,0 +1,217 @@
+#!/bin/bash
+# BEGIN COPYRIGHT BLOCK
+# (C) 2011 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+
+# Always switch into the base directory three levels
+# above this shell script prior to executing it so
+# that all of its output is written to this directory
+cd `dirname $0`/../..
+
+# Retrieve the name of this base directory
+PKI_PWD=`pwd`
+
+# Establish the name of the machine
+PKI_HOSTNAME=`hostname`
+
+# Set pre-defined variables
+PKI_DIR="pki"
+PKI_FLAVOR="dogtag"
+PKI_SCRIPTS_DIR="scripts"
+ROOT_UID=0
+
+# This script may ONLY be run on Linux!
+PKI_OS=`uname`
+if [ "${PKI_OS}" != "Linux" ]; then
+ printf "The '$0' script is ONLY executable\n"
+ printf "on a 'Linux' machine!\n"
+ exit 255
+fi
+PKI_ARCH=`uname -p`
+NOARCH="noarch"
+
+# Set packaging variables
+YUM_EXE="/usr/bin/yum"
+YUM_EXE_OPTIONS="-y --nogpgcheck install"
+RPM_DIR="RPMS"
+RPM_EXT="-[0-9]*.rpm"
+COMBINED="combined"
+
+# Set sudo variables
+PKI_SUDO="/usr/bin/sudo"
+PKI_SUDOERS="/etc/sudoers"
+
+# Set user identity variables
+PKI_EUID=`/usr/bin/id -u`
+PKI_UID=`/usr/bin/id -ur`
+PKI_USERNAME=`/usr/bin/id -un`
+
+# Make sure that this script is NOT being run as root!
+if [ ${PKI_UID} -eq ${ROOT_UID} ] ||
+ [ ${PKI_EUID} -eq ${ROOT_UID} ]; then
+ printf "The '$0' script may NOT be run as root!\n"
+ exit 255
+fi
+
+# Check for the presence of the 'sudo' executable
+if [ ! -x "${PKI_SUDO}" ]; then
+ printf "The '$0' script requires the '${PKI_SUDO}' executable\n"
+ printf "to be available on '${PKI_HOSTNAME}'!\n"
+ exit 255
+fi
+
+# Check for the presence of the 'sudoers' file
+if [ ! -e "${PKI_SUDOERS}" ]; then
+ printf "The '$0' script requires the '${PKI_SUDOERS}' file\n"
+ printf "to be available on '${PKI_HOSTNAME}'!\n"
+ exit 255
+fi
+
+# Check for the presence of the required sudoers command
+PKI_SUDOERS_COMMAND="(root) NOPASSWD: ${YUM_EXE}"
+PKI_SUDOERS_LINE="${PKI_USERNAME} ALL = NOPASSWD: ${YUM_EXE}"
+printf "Checking if '${PKI_USERNAME}' has the appropriate '${PKI_SUDO}' permissions . . .\n"
+printf "[NOTE: A password prompt may appear requiring ${PKI_USERNAME}'s password.]\n"
+`${PKI_SUDO} -l | grep "${PKI_SUDOERS_COMMAND}" > /dev/null 2>&1`
+if [ $? -ne 0 ]; then
+ printf "The '$0' script requires that the\n"
+ printf "'${PKI_SUDOERS}' file MUST contain this line:\n\n"
+ printf " '${PKI_SUDOERS_LINE}'\n\n"
+ exit 255
+fi
+
+# Set 'composition scripts' variables
+PKI_COMPOSE_SCRIPTS_DIR="${PKI_PWD}/${PKI_DIR}/${PKI_SCRIPTS_DIR}"
+COMPOSE_DOGTAG_PKI_THEME_PACKAGES="compose_dogtag_pki_theme_packages"
+COMPOSE_PKI_CORE_PACKAGES="compose_pki_core_packages"
+COMPOSE_PKI_KRA_PACKAGES="compose_pki_kra_packages"
+COMPOSE_PKI_OCSP_PACKAGES="compose_pki_ocsp_packages"
+COMPOSE_PKI_RA_PACKAGES="compose_pki_ra_packages"
+COMPOSE_PKI_TKS_PACKAGES="compose_pki_tks_packages"
+COMPOSE_PKI_TPS_PACKAGES="compose_pki_tps_packages"
+COMPOSE_PKI_CONSOLE_PACKAGES="compose_pki_console_packages"
+
+# Establish 'packages' directories variables
+PKI_PACKAGES_DIR="${PKI_PWD}/packages"
+PKI_DOGTAG_THEME_PACKAGES_DIR="${PKI_PWD}/packages.dogtag_theme"
+PKI_CORE_PACKAGES_DIR="${PKI_PWD}/packages.core"
+PKI_KRA_PACKAGES_DIR="${PKI_PWD}/packages.kra"
+PKI_OCSP_PACKAGES_DIR="${PKI_PWD}/packages.ocsp"
+PKI_RA_PACKAGES_DIR="${PKI_PWD}/packages.ra"
+PKI_TKS_PACKAGES_DIR="${PKI_PWD}/packages.tks"
+PKI_TPS_PACKAGES_DIR="${PKI_PWD}/packages.tps"
+PKI_CONSOLE_PACKAGES_DIR="${PKI_PWD}/packages.console"
+
+# Establish PKI theme package names
+PKI_COMMON_THEME=${PKI_FLAVOR}-pki-common-theme${RPM_EXT}
+PKI_CA_THEME=${PKI_FLAVOR}-pki-ca-theme${RPM_EXT}
+PKI_KRA_THEME=${PKI_FLAVOR}-pki-kra-theme${RPM_EXT}
+PKI_OCSP_THEME=${PKI_FLAVOR}-pki-ocsp-theme${RPM_EXT}
+PKI_RA_THEME=${PKI_FLAVOR}-pki-ra-theme${RPM_EXT}
+PKI_TKS_THEME=${PKI_FLAVOR}-pki-tks-theme${RPM_EXT}
+PKI_TPS_THEME=${PKI_FLAVOR}-pki-tps-theme${RPM_EXT}
+PKI_CONSOLE_THEME=${PKI_FLAVOR}-pki-console-theme${RPM_EXT}
+
+# Establish PKI core package names
+PKI_SETUP=pki-setup${RPM_EXT}
+PKI_SYMKEY=pki-symkey${RPM_EXT}
+PKI_NATIVE_TOOLS=pki-native-tools${RPM_EXT}
+PKI_UTIL=pki-util${RPM_EXT}
+PKI_UTIL_JAVADOC=pki-util-javadoc${RPM_EXT}
+PKI_JAVA_TOOLS=pki-java-tools${RPM_EXT}
+PKI_JAVA_TOOLS_JAVADOC=pki-java-tools-javadoc${RPM_EXT}
+PKI_COMMON=pki-common${RPM_EXT}
+PKI_COMMON_JAVADOC=pki-common-javadoc${RPM_EXT}
+PKI_SELINUX=pki-selinux${RPM_EXT}
+PKI_CA=pki-ca${RPM_EXT}
+PKI_SILENT=pki-silent${RPM_EXT}
+
+# Establish PKI kra package names
+PKI_KRA=pki-kra${RPM_EXT}
+
+# Establish PKI ocsp package names
+PKI_OCSP=pki-ocsp${RPM_EXT}
+
+# Establish PKI ra package names
+PKI_RA=pki-ra${RPM_EXT}
+
+# Establish PKI tks package names
+PKI_TKS=pki-tks${RPM_EXT}
+
+# Establish PKI tps package names
+PKI_TPS=pki-tps${RPM_EXT}
+
+# Establish PKI console package names
+PKI_CONSOLE=pki-console${RPM_EXT}
+
+# Always start with new package directories
+rm -rf ${PKI_PACKAGES_DIR}
+rm -rf ${PKI_DOGTAG_THEME_PACKAGES_DIR}
+rm -rf ${PKI_CORE_PACKAGES_DIR}
+rm -rf ${PKI_KRA_PACKAGES_DIR}
+rm -rf ${PKI_OCSP_PACKAGES_DIR}
+rm -rf ${PKI_RA_PACKAGES_DIR}
+rm -rf ${PKI_TKS_PACKAGES_DIR}
+rm -rf ${PKI_TPS_PACKAGES_DIR}
+rm -rf ${PKI_CONSOLE_PACKAGES_DIR}
+
+# Compose and install 'dogtag-pki-theme' packages
+cd ${PKI_PWD}
+${PKI_COMPOSE_SCRIPTS_DIR}/${COMPOSE_DOGTAG_PKI_THEME_PACKAGES} rpms
+mv ${PKI_PACKAGES_DIR} ${PKI_DOGTAG_THEME_PACKAGES_DIR}
+cd ${PKI_DOGTAG_THEME_PACKAGES_DIR}/${RPM_DIR}/${NOARCH}
+${PKI_SUDO} ${YUM_EXE} ${YUM_EXE_OPTIONS} ${PKI_COMMON_THEME} ${PKI_CA_THEME} ${PKI_KRA_THEME} ${PKI_OCSP_THEME} ${PKI_RA_THEME} ${PKI_TKS_THEME} ${PKI_TPS_THEME} ${PKI_CONSOLE_THEME}
+
+# Compose and install 'pki-core' packages
+cd ${PKI_PWD}
+${PKI_COMPOSE_SCRIPTS_DIR}/${COMPOSE_PKI_CORE_PACKAGES} rpms
+mv ${PKI_PACKAGES_DIR} ${PKI_CORE_PACKAGES_DIR}
+cd ${PKI_CORE_PACKAGES_DIR}/${RPM_DIR}
+mkdir -p ${PKI_CORE_PACKAGES_DIR}/${RPM_DIR}/${COMBINED}
+cp -p ${NOARCH}/*.rpm ${PKI_ARCH}/*.rpm ${PKI_CORE_PACKAGES_DIR}/${RPM_DIR}/${COMBINED}
+cd ${PKI_CORE_PACKAGES_DIR}/${RPM_DIR}/${COMBINED}
+${PKI_SUDO} ${YUM_EXE} ${YUM_EXE_OPTIONS} ${PKI_SETUP} ${PKI_SYMKEY} ${PKI_NATIVE_TOOLS} ${PKI_UTIL} ${PKI_UTIL_JAVADOC} ${PKI_JAVA_TOOLS} ${PKI_JAVA_TOOLS_JAVADOC} ${PKI_COMMON} ${PKI_COMMON_JAVADOC} ${PKI_SELINUX} ${PKI_CA} ${PKI_SILENT}
+
+# Compose and install 'pki-kra' packages
+cd ${PKI_PWD}
+${PKI_COMPOSE_SCRIPTS_DIR}/${COMPOSE_PKI_KRA_PACKAGES} rpms
+mv ${PKI_PACKAGES_DIR} ${PKI_KRA_PACKAGES_DIR}
+cd ${PKI_KRA_PACKAGES_DIR}/${RPM_DIR}/${NOARCH}
+${PKI_SUDO} ${YUM_EXE} ${YUM_EXE_OPTIONS} ${PKI_KRA}
+
+# Compose and install 'pki-ocsp' packages
+cd ${PKI_PWD}
+${PKI_COMPOSE_SCRIPTS_DIR}/${COMPOSE_PKI_OCSP_PACKAGES} rpms
+mv ${PKI_PACKAGES_DIR} ${PKI_OCSP_PACKAGES_DIR}
+cd ${PKI_OCSP_PACKAGES_DIR}/${RPM_DIR}/${NOARCH}
+${PKI_SUDO} ${YUM_EXE} ${YUM_EXE_OPTIONS} ${PKI_OCSP}
+
+# Compose and install 'pki-ra' packages
+cd ${PKI_PWD}
+${PKI_COMPOSE_SCRIPTS_DIR}/${COMPOSE_PKI_RA_PACKAGES} rpms
+mv ${PKI_PACKAGES_DIR} ${PKI_RA_PACKAGES_DIR}
+cd ${PKI_RA_PACKAGES_DIR}/${RPM_DIR}/${NOARCH}
+${PKI_SUDO} ${YUM_EXE} ${YUM_EXE_OPTIONS} ${PKI_RA}
+
+# Compose and install 'pki-tks' packages
+cd ${PKI_PWD}
+${PKI_COMPOSE_SCRIPTS_DIR}/${COMPOSE_PKI_TKS_PACKAGES} rpms
+mv ${PKI_PACKAGES_DIR} ${PKI_TKS_PACKAGES_DIR}
+cd ${PKI_TKS_PACKAGES_DIR}/${RPM_DIR}/${NOARCH}
+${PKI_SUDO} ${YUM_EXE} ${YUM_EXE_OPTIONS} ${PKI_TKS}
+
+# Compose and install 'pki-tps' packages
+cd ${PKI_PWD}
+${PKI_COMPOSE_SCRIPTS_DIR}/${COMPOSE_PKI_TPS_PACKAGES} rpms
+mv ${PKI_PACKAGES_DIR} ${PKI_TPS_PACKAGES_DIR}
+cd ${PKI_TPS_PACKAGES_DIR}/${RPM_DIR}/${PKI_ARCH}
+${PKI_SUDO} ${YUM_EXE} ${YUM_EXE_OPTIONS} ${PKI_TPS}
+
+# Compose and install 'pki-console' packages
+cd ${PKI_PWD}
+${PKI_COMPOSE_SCRIPTS_DIR}/${COMPOSE_PKI_CONSOLE_PACKAGES} rpms
+mv ${PKI_PACKAGES_DIR} ${PKI_CONSOLE_PACKAGES_DIR}
+cd ${PKI_CONSOLE_PACKAGES_DIR}/${RPM_DIR}/${NOARCH}
+${PKI_SUDO} ${YUM_EXE} ${YUM_EXE_OPTIONS} ${PKI_CONSOLE}
+
diff --git a/pki/scripts/compose_dogtag_pki_theme_packages b/pki/scripts/compose_dogtag_pki_theme_packages
index db5b7ffe9..e10ee22a6 100755
--- a/pki/scripts/compose_dogtag_pki_theme_packages
+++ b/pki/scripts/compose_dogtag_pki_theme_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
DOGTAG_PKI_THEME="dogtag-pki-theme"
-DOGTAG_PKI_THEME_VERSION="9.0.5"
+DOGTAG_PKI_THEME_VERSION="9.0.6"
##
diff --git a/pki/scripts/compose_ipa_pki_theme_packages b/pki/scripts/compose_ipa_pki_theme_packages
index 5f4db9818..154b0681d 100755
--- a/pki/scripts/compose_ipa_pki_theme_packages
+++ b/pki/scripts/compose_ipa_pki_theme_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
IPA_PKI_THEME="ipa-pki-theme"
-IPA_PKI_THEME_VERSION="9.0.3"
+IPA_PKI_THEME_VERSION="9.0.4"
##
diff --git a/pki/scripts/compose_pki_console_packages b/pki/scripts/compose_pki_console_packages
index 7c59712c1..2d656025c 100755
--- a/pki/scripts/compose_pki_console_packages
+++ b/pki/scripts/compose_pki_console_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
PKI_CONSOLE="pki-console"
-PKI_CONSOLE_VERSION="9.0.2"
+PKI_CONSOLE_VERSION="9.0.3"
##
diff --git a/pki/scripts/compose_pki_core_packages b/pki/scripts/compose_pki_core_packages
index 3963b0f24..399d39ca6 100755
--- a/pki/scripts/compose_pki_core_packages
+++ b/pki/scripts/compose_pki_core_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
PKI_CORE="pki-core"
-PKI_CORE_VERSION="9.0.8"
+PKI_CORE_VERSION="9.0.9"
##
diff --git a/pki/scripts/compose_pki_kra_packages b/pki/scripts/compose_pki_kra_packages
index 95c15f37f..04c82fb23 100755
--- a/pki/scripts/compose_pki_kra_packages
+++ b/pki/scripts/compose_pki_kra_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
PKI_KRA="pki-kra"
-PKI_KRA_VERSION="9.0.3"
+PKI_KRA_VERSION="9.0.4"
##
diff --git a/pki/scripts/compose_pki_migrate_packages b/pki/scripts/compose_pki_migrate_packages
index b7897ab32..863a7a688 100755
--- a/pki/scripts/compose_pki_migrate_packages
+++ b/pki/scripts/compose_pki_migrate_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
PKI_MIGRATE="pki-migrate"
-PKI_MIGRATE_VERSION="9.0.0"
+PKI_MIGRATE_VERSION="9.0.1"
##
diff --git a/pki/scripts/compose_pki_ocsp_packages b/pki/scripts/compose_pki_ocsp_packages
index e80bfed72..4f939658c 100755
--- a/pki/scripts/compose_pki_ocsp_packages
+++ b/pki/scripts/compose_pki_ocsp_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
PKI_OCSP="pki-ocsp"
-PKI_OCSP_VERSION="9.0.2"
+PKI_OCSP_VERSION="9.0.3"
##
diff --git a/pki/scripts/compose_pki_ra_packages b/pki/scripts/compose_pki_ra_packages
index 29ed25996..6d58e637c 100755
--- a/pki/scripts/compose_pki_ra_packages
+++ b/pki/scripts/compose_pki_ra_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
PKI_RA="pki-ra"
-PKI_RA_VERSION="9.0.2"
+PKI_RA_VERSION="9.0.3"
##
diff --git a/pki/scripts/compose_pki_tks_packages b/pki/scripts/compose_pki_tks_packages
index ccaf17c4b..2afda84fb 100755
--- a/pki/scripts/compose_pki_tks_packages
+++ b/pki/scripts/compose_pki_tks_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
PKI_TKS="pki-tks"
-PKI_TKS_VERSION="9.0.2"
+PKI_TKS_VERSION="9.0.3"
##
diff --git a/pki/scripts/compose_pki_tps_packages b/pki/scripts/compose_pki_tps_packages
index e3c08bf2c..93f427bac 100755
--- a/pki/scripts/compose_pki_tps_packages
+++ b/pki/scripts/compose_pki_tps_packages
@@ -31,7 +31,7 @@ PKI_PWD=`pwd`
##
PKI_TPS="pki-tps"
-PKI_TPS_VERSION="9.0.4"
+PKI_TPS_VERSION="9.0.5"
##
diff --git a/pki/scripts/create_pki_yum_repos b/pki/scripts/create_pki_yum_repos
new file mode 100755
index 000000000..b900e180f
--- /dev/null
+++ b/pki/scripts/create_pki_yum_repos
@@ -0,0 +1,78 @@
+#!/bin/bash
+
+# This script may ONLY be run on Linux!
+PKI_OS=`uname`
+if [ "${PKI_OS}" != "Linux" ]; then
+ printf "The '$0' script is ONLY executable\n"
+ printf "on a 'Linux' machine!\n"
+ exit 255
+fi
+
+# Always switch into the base directory three levels
+# above this shell script prior to executing it so
+# that all of its output is written to this directory
+cd `dirname $0`/../..
+
+# Retrieve the name of this base directory
+PKI_PWD=`pwd`
+
+# Establish a list of 'packages' directories
+PKI_PACKAGE_DIRS_LIST="packages packages.dogtag_theme packages.ipa_theme packages.core packages.kra packages.ocsp packages.ra packages.tks packages.tps packages.console"
+
+# This script is only executable from the directory
+# containing at the "./pki" directory!
+if [ ! -d ./pki ]; then
+ printf "The '$0' script is ONLY executable\n"
+ printf "from the directory containing './pki'!\n"
+ exit 255
+fi
+
+printf "Removing any 'RPMS/' and 'SRPMS/' directories . . . "
+if [ -d RPMS ]; then
+ rm -rf RPMS
+fi
+if [ -d SRPMS ]; then
+ rm -rf SRPMS
+fi
+printf "done.\n\n"
+
+printf "Creating new 'RPMS/' and 'SRPMS/' directories . . . "
+mkdir RPMS SRPMS
+printf "done.\n\n"
+
+printf "Copying all 'RPMS' and 'SRPMS' into the 'RPMS/' directory . . . "
+for package_dir in ${PKI_PACKAGE_DIRS_LIST} ;
+do
+ if [ -d ${package_dir} ] ; then
+ cd ${package_dir}
+ find . -name "*.rpm" | xargs -n1 -I{} cp -p {} ../RPMS
+ cd ..
+ fi
+done
+printf "done.\n\n"
+
+printf "Moving all 'SRPMS' into the 'SRPMS/' directory . . . "
+mv ./RPMS/*.src.rpm ./SRPMS
+printf "done.\n\n"
+
+if [ -x /usr/bin/createrepo ]; then
+ printf "Attempting to create a yum repo in the 'RPMS/' directory . . .\n"
+ /usr/bin/createrepo ./RPMS
+ printf "done.\n\n"
+
+ printf "Attempting to create a yum repo in the 'SRPMS/' directory . . .\n"
+ /usr/bin/createrepo ./SRPMS
+ printf "done.\n\n"
+fi
+
+printf "Counting all 'RPMS' . . . "
+RPM_COUNT=`ls -1 ./RPMS/*.rpm | wc -l`
+printf "done.\n\n"
+
+printf "Counting all 'SRPMS' . . . "
+SRPM_COUNT=`ls -1 ./SRPMS/*.rpm | wc -l`
+printf "done.\n\n"
+
+printf "TOTAL: RPMS = ${RPM_COUNT}\n"
+printf " SRPMS = ${SRPM_COUNT}\n\n"
+
diff --git a/pki/scripts/install_default_ca_instance b/pki/scripts/install_default_ca_instance
new file mode 100755
index 000000000..7de098018
--- /dev/null
+++ b/pki/scripts/install_default_ca_instance
@@ -0,0 +1,56 @@
+#!/bin/bash
+# BEGIN COPYRIGHT BLOCK
+# (C) 2010 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+
+## Always switch into this base directory
+## prior to script execution so that all
+## of its output is written to this directory
+
+cd `dirname $0`
+
+
+##
+## This script MUST be run as root!
+##
+
+ROOTUID=0
+
+OS=`uname`
+if [ "${OS}" = "Linux" ] ; then
+ MY_EUID=`/usr/bin/id -u`
+ MY_UID=`/usr/bin/id -ur`
+ USERNAME=`/usr/bin/id -un`
+else
+ printf "ERROR: Unsupported operating system '${OS}'!\n"
+ exit 255
+fi
+
+if [ "${MY_UID}" != "${ROOTUID}" ] &&
+ [ "${MY_EUID}" != "${ROOTUID}" ] ; then
+ printf "ERROR: The '$0' script must be run as root!\n"
+ exit 255
+fi
+
+
+
+##
+## Define DEFAULT CA Instance
+##
+
+pkicreate -pki_instance_root=/var/lib \
+ -pki_instance_name=pki-ca \
+ -subsystem_type=ca \
+ -agent_secure_port=9443 \
+ -ee_secure_port=9444 \
+ -ee_secure_client_auth_port=9446 \
+ -admin_secure_port=9445 \
+ -unsecure_port=9180 \
+ -tomcat_server_port=9701 \
+ -user=pkiuser \
+ -group=pkiuser \
+ -redirect conf=/etc/pki-ca \
+ -redirect logs=/var/log/pki-ca \
+ -verbose
+
diff --git a/pki/scripts/install_default_pki_instances b/pki/scripts/install_default_pki_instances
new file mode 100755
index 000000000..7c1bc9db3
--- /dev/null
+++ b/pki/scripts/install_default_pki_instances
@@ -0,0 +1,122 @@
+#!/bin/bash
+# BEGIN COPYRIGHT BLOCK
+# (C) 2010 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+
+## Always switch into this base directory
+## prior to script execution so that all
+## of its output is written to this directory
+
+cd `dirname $0`
+
+
+##
+## This script MUST be run as root!
+##
+
+ROOTUID=0
+
+OS=`uname`
+if [ "${OS}" = "Linux" ] ; then
+ MY_EUID=`/usr/bin/id -u`
+ MY_UID=`/usr/bin/id -ur`
+ USERNAME=`/usr/bin/id -un`
+else
+ printf "ERROR: Unsupported operating system '${OS}'!\n"
+ exit 255
+fi
+
+if [ "${MY_UID}" != "${ROOTUID}" ] &&
+ [ "${MY_EUID}" != "${ROOTUID}" ] ; then
+ printf "ERROR: The '$0' script must be run as root!\n"
+ exit 255
+fi
+
+
+
+##
+## Define DEFAULT PKI Instances
+##
+
+pkicreate -pki_instance_root=/var/lib \
+ -pki_instance_name=pki-ca \
+ -subsystem_type=ca \
+ -agent_secure_port=9443 \
+ -ee_secure_port=9444 \
+ -ee_secure_client_auth_port=9446 \
+ -admin_secure_port=9445 \
+ -unsecure_port=9180 \
+ -tomcat_server_port=9701 \
+ -user=pkiuser \
+ -group=pkiuser \
+ -redirect conf=/etc/pki-ca \
+ -redirect logs=/var/log/pki-ca \
+ -verbose
+
+pkicreate -pki_instance_root=/var/lib \
+ -pki_instance_name=pki-kra \
+ -subsystem_type=kra \
+ -agent_secure_port=10443 \
+ -ee_secure_port=10444 \
+ -admin_secure_port=10445 \
+ -unsecure_port=10180 \
+ -tomcat_server_port=10701 \
+ -user=pkiuser \
+ -group=pkiuser \
+ -redirect conf=/etc/pki-kra \
+ -redirect logs=/var/log/pki-kra \
+ -verbose
+
+pkicreate -pki_instance_root=/var/lib \
+ -pki_instance_name=pki-ocsp \
+ -subsystem_type=ocsp \
+ -agent_secure_port=11443 \
+ -ee_secure_port=11444 \
+ -admin_secure_port=11445 \
+ -unsecure_port=11180 \
+ -tomcat_server_port=11701 \
+ -user=pkiuser \
+ -group=pkiuser \
+ -redirect conf=/etc/pki-ocsp \
+ -redirect logs=/var/log/pki-ocsp \
+ -verbose
+
+pkicreate -pki_instance_root=/var/lib \
+ -pki_instance_name=pki-tks \
+ -subsystem_type=tks \
+ -agent_secure_port=13443 \
+ -ee_secure_port=13444 \
+ -admin_secure_port=13445 \
+ -unsecure_port=13180 \
+ -tomcat_server_port=13701 \
+ -user=pkiuser \
+ -group=pkiuser \
+ -redirect conf=/etc/pki-tks \
+ -redirect logs=/var/log/pki-tks \
+ -verbose
+
+pkicreate -pki_instance_root=/var/lib \
+ -pki_instance_name=pki-ra \
+ -subsystem_type=ra \
+ -secure_port=12889 \
+ -non_clientauth_secure_port=12890 \
+ -unsecure_port=12888 \
+ -user=pkiuser \
+ -group=pkiuser \
+ -redirect conf=/etc/pki-ra \
+ -redirect logs=/var/log/pki-ra \
+ -verbose
+
+pkicreate -pki_instance_root=/var/lib \
+ -pki_instance_name=pki-tps \
+ -subsystem_type=tps \
+ -secure_port=7889 \
+ -non_clientauth_secure_port=7890 \
+ -unsecure_port=7888 \
+ -user=pkiuser \
+ -group=pkiuser \
+ -redirect conf=/etc/pki-tps \
+ -redirect logs=/var/log/pki-tps \
+ -verbose
+
diff --git a/pki/scripts/prepare_pki b/pki/scripts/prepare_pki
new file mode 100755
index 000000000..6027e44dd
--- /dev/null
+++ b/pki/scripts/prepare_pki
@@ -0,0 +1,189 @@
+#!/bin/bash
+# BEGIN COPYRIGHT BLOCK
+# (C) 2007 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+
+# Always switch into the base directory of this
+# shell script prior to executing it so that all
+# of its output is written to this directory
+cd `dirname $0`
+
+# Retrieve the name of this base directory
+PKI_PWD=`pwd`
+
+# Establish the name of the machine
+PKI_HOSTNAME=`hostname`
+
+# Set pre-defined variables
+ROOT_UID=0
+
+# This script may ONLY be run on Linux!
+PKI_OS=`uname`
+if [ "${PKI_OS}" != "Linux" ]; then
+ printf "The '$0' script is ONLY executable\n"
+ printf "on a 'Linux' machine!\n"
+ exit 255
+fi
+
+# For Fedora machines, compute the FEDORA_VERSION
+if [ -e /etc/fedora-release ]; then
+ FEDORA_VERSION=`rpm -qf --qf='%{VERSION}' /etc/fedora-release | tr -d [A-Z] | tr -d [a-z]`
+else
+ # For now, just give FEDORA_VERSION a bogus value if not using Fedora.
+ FEDORA_VERSION=9999
+fi
+
+# Set Linux variables
+PKI_PLATFORM="LINUX"
+PKI_UPDATE="/usr/bin/yum"
+PKI_UPDATE_OPTIONS="-y install"
+PKI_UPDATE_DIR=""
+
+# Set sudo variables
+PKI_SUDO="/usr/bin/sudo"
+PKI_SUDOERS="/etc/sudoers"
+
+# Set user identity variables
+PKI_EUID=`/usr/bin/id -u`
+PKI_UID=`/usr/bin/id -ur`
+PKI_USERNAME=`/usr/bin/id -un`
+
+# Make sure that this script is NOT being run as root!
+if [ ${PKI_UID} -eq ${ROOT_UID} ] ||
+ [ ${PKI_EUID} -eq ${ROOT_UID} ]; then
+ printf "The '$0' script may NOT be run as root!\n"
+ exit 255
+fi
+
+# Check for the presence of the 'sudo' executable
+if [ ! -x "${PKI_SUDO}" ]; then
+ printf "The '$0' script requires the '${PKI_SUDO}' executable\n"
+ printf "to be available on '${PKI_HOSTNAME}'!\n"
+ exit 255
+fi
+
+# Check for the presence of the 'sudoers' file
+if [ ! -e "${PKI_SUDOERS}" ]; then
+ printf "The '$0' script requires the '${PKI_SUDOERS}' file\n"
+ printf "to be available on '${PKI_HOSTNAME}'!\n"
+ exit 255
+fi
+
+# Check for the presence of the required sudoers command
+PKI_SUDOERS_COMMAND="(root) NOPASSWD: ${RPM_EXE}"
+PKI_SUDOERS_LINE="${PKI_USERNAME} ALL = NOPASSWD: ${RPM_EXE}"
+printf "Checking if '${PKI_USERNAME}' has the appropriate '${PKI_SUDO}' permissions . . .\n"
+printf "[NOTE: A password prompt may appear requiring ${PKI_USERNAME}'s password.]\n"
+`${PKI_SUDO} -l | grep "${PKI_SUDOERS_COMMAND}" > /dev/null 2>&1`
+if [ $? -ne 0 ]; then
+ printf "The '$0' script requires that the\n"
+ printf "'${PKI_SUDOERS}' file MUST contain this line:\n\n"
+ printf " '${PKI_SUDOERS_LINE}'\n\n"
+ exit 255
+fi
+
+# Establish PKI support package names
+NSPR=nspr
+NSPR_DEVEL=nspr-devel
+NSS=nss
+NSS_DEVEL=nss-devel
+NSS_TOOLS=nss-tools
+JSS=jss
+JSS_JAVADOC=jss-javadoc
+SVRCORE=svrcore
+SVRCORE_DEVEL=svrcore-devel
+CYRUS_SASL=cyrus-sasl
+CYRUS_SASL_DEVEL=cyrus-sasl-devel
+OPENLDAP=openldap
+OPENLDAP_DEVEL=openldap-devel
+OPENLDAP_CLIENTS=openldap-tools
+PERL=perl
+APR=apr
+PCRE=pcre
+EXPAT=expat
+APR_UTIL=apr-util
+HTTPD=httpd
+MOD_NSS=mod_nss
+MOD_PERL=mod_perl
+PERL_PARSE_RECDESCENT=perl-Parse-RecDescent
+PERL_HTML_TAGSET=perl-HTML-Tagset
+PERL_HTML_PARSER=perl-HTML-Parser
+PERL_URI=perl-URI
+PERL_LIBWWW_PERL=perl-libwww-perl
+PERL_XML_PARSER=perl-XML-Parser
+PERL_XML_SIMPLE=perl-XML-Simple
+PERL_XML_NAMESPACESUPPORT=perl-XML-NamespaceSupport
+PERL_XML_SAX=perl-XML-SAX
+JPACKAGE_UTILS=jpackage-utils
+JAKARTA_COMMONS_LOGGING=jakarta-commons-logging
+TOMCAT5_SERVLET_2_4_API=tomcat5-servlet-2.4-api
+JAKARTA_COMMONS_COLLECTIONS=jakarta-commons-collections
+JAKARTA_COMMONS_BEANUTILS=jakarta-commons-beanutils
+JAKARTA_COMMONS_DIGESTER=jakarta-commons-digester
+ORO=oro
+CLASSPATHX_JAF=classpathx-jaf
+LDAPJDK=ldapjdk
+JAKARTA_COMMONS_POOL=jakarta-commons-pool
+JAKARTA_COMMONS_FILEUPLOAD=jakarta-commons-fileupload
+XML_COMMONS=xml-commons
+XML_COMMONS_APIS=xml-commons-apis
+REGEXP=regexp
+BCEL=bcel
+JAKARTA_COMMONS_DBCP=jakarta-commons-dbcp
+TOMCAT5_JASPER=tomcat5-jasper
+JAKARTA_COMMONS_DISCOVERY=jakarta-commons-discovery
+JAKARTA_COMMONS_HTTPCLIENT3=jakarta-commons-httpclient3
+JMS=jms
+JAKARTA_COMMONS_LAUNCHER=jakarta-commons-launcher
+JAKARTA_COMMONS_EL=jakarta-commons-el
+JAKARTA_COMMONS_DAEMON=jakarta-commons-daemon
+if [ ${FEDORA_VERSION} -eq 6 ]; then
+ # Required by Fedora Core 6
+ GNU_CRYPTO_SASL_JDK1_4=gnu-crypto-sasl-jdk1.4
+else
+ GNU_CRYPTO_SASL_JDK1_4=
+fi
+CLASSPATHX_MAIL=classpathx-mail
+XERCES_J2=xerces-j2
+XALAN_J2=xalan-j2
+LOG4J=log4j
+XML_COMMONS_RESOLVER=xml-commons-resolver
+AVALON_LOGKIT=avalon-logkit
+AVALON_FRAMEWORK=avalon-framework
+JDOM=jdom
+WERKEN_XPATH=werken-xpath
+VELOCITY=velocity
+ANT=ant
+WSDL4J=wsdl4j
+AXIS=axis
+MX4J=mx4j
+GERONIMO_SPECS=geronimo-specs
+JAKARTA_COMMONS_MODELER=jakarta-commons-modeler
+IDM_CONSOLE_FRAMEWORK=idm-console-framework
+TOMCAT5=tomcat5
+TOMCATJSS=tomcatjss
+MAKE=make
+M4=m4
+POLICYCOREUTILS=policycoreutils
+SELINUX_POLICY_DEVEL=selinux-policy-devel
+SELINUX_POLICY_TARGETED=selinux-policy-targeted
+READLINE=readline
+READLINE_DEVEL=readline-devel
+NCURSES=ncurses
+NCURSES_DEVEL=ncurses-devel
+TCL=tcl
+TCL_DEVEL=tcl-devel
+SQLITE=sqlite
+SQLITE_DEVEL=sqlite-devel
+PERL_DBI=perl-DBI
+PERL_DBD_SQLITE=perl-DBD-SQLite
+PCRE_DEVEL=pcre-devel
+EXPAT_DEVEL=expat-devel
+APR_DEVEL=apr-devel
+APR_UTIL_DEVEL=apr-util-devel
+HTTPD_DEVEL=httpd-devel
+
+# Build and install PKI support packages
+${PKI_SUDO} ${PKI_UPDATE} ${PKI_UPDATE_OPTIONS} ${NSPR} ${NSPR_DEVEL} ${NSS} ${NSS_DEVEL} ${NSS_TOOLS} ${JSS} ${JSS_JAVADOC} ${SVRCORE} ${SVRCORE_DEVEL} ${CYRUS_SASL} ${CYRUS_SASL_DEVEL} ${OPENLDAP} ${OPENLDAP_DEVEL} ${OPENLDAP_CLIENTS} ${PERL} ${APR} ${PCRE} ${EXPAT} ${APR_UTIL} ${HTTPD} ${MOD_NSS} ${MOD_PERL} ${PERL_PARSE_RECDESCENT} ${PERL_HTML_TAGSET} ${PERL_HTML_PARSER} ${PERL_URI} ${PERL_LIBWWW_PERL} ${PERL_XML_PARSER} ${PERL_XML_SIMPLE} ${PERL_XML_NAMESPACESUPPORT} ${PERL_XML_SAX} ${JPACKAGE_UTILS} ${JAKARTA_COMMONS_LOGGING} ${TOMCAT5_SERVLET_2_4_API} ${JAKARTA_COMMONS_COLLECTIONS} ${JAKARTA_COMMONS_BEANUTILS} ${JAKARTA_COMMONS_DIGESTER} ${ORO} ${CLASSPATHX_JAF} ${LDAPJDK} ${JAKARTA_COMMONS_POOL} ${JAKARTA_COMMONS_FILEUPLOAD} ${XML_COMMONS} ${XML_COMMONS_APIS} ${REGEXP} ${BCEL} ${JAKARTA_COMMONS_DBCP} ${TOMCAT5_JASPER} ${JAKARTA_COMMONS_DISCOVERY} ${JAKARTA_COMMONS_HTTPCLIENT3} ${JMS} ${JAKARTA_COMMONS_LAUNCHER} ${JAKARTA_COMMONS_EL} ${JAKARTA_COMMONS_DAEMON} ${GNU_CRYPTO_SASL_JDK1_4} ${CLASSPATHX_MAIL} ${XERCES_J2} ${XALAN_J2} ${LOG4J} ${XML_COMMONS_RESOLVER} ${AVALON_LOGKIT} ${AVALON_FRAMEWORK} ${JDOM} ${WERKEN_XPATH} ${VELOCITY} ${ANT} ${WSDL4J} ${AXIS} ${MX4J} ${GERONIMO_SPECS} ${JAKARTA_COMMONS_MODELER} ${IDM_CONSOLE_FRAMEWORK} ${TOMCAT5} ${TOMCATJSS} ${MAKE} ${M4} ${POLICYCOREUTILS} ${SELINUX_POLICY_DEVEL} ${SELINUX_POLICY_TARGETED} ${READLINE} ${READLINE_DEVEL} ${NCURSES} ${NCURSES_DEVEL} ${TCL} ${TCL_DEVEL} ${SQLITE} ${SQLITE_DEVEL} ${PERL_DBI} ${PERL_DBD_SQLITE} ${PCRE_DEVEL} ${EXPAT_DEVEL} ${APR_DEVEL} ${APR_UTIL_DEVEL} ${HTTPD_DEVEL}
+
diff --git a/pki/scripts/remove_default_pki_instances b/pki/scripts/remove_default_pki_instances
new file mode 100755
index 000000000..3ec355f1f
--- /dev/null
+++ b/pki/scripts/remove_default_pki_instances
@@ -0,0 +1,115 @@
+#!/bin/bash
+## BEGIN COPYRIGHT BLOCK
+## (C) 2008 Red Hat, Inc.
+## All rights reserved.
+## END COPYRIGHT BLOCK
+
+## Always switch into this base directory
+## prior to script execution so that all
+## of its output is written to this directory
+
+cd `dirname $0`
+
+
+##
+## This script MUST be run as root!
+##
+
+ROOTUID=0
+
+OS=`uname`
+if [ "${OS}" = "Linux" ] ; then
+ MY_EUID=`/usr/bin/id -u`
+ MY_UID=`/usr/bin/id -ur`
+ USERNAME=`/usr/bin/id -un`
+else
+ printf "ERROR: Unsupported operating system '${OS}'!\n"
+ exit 255
+fi
+
+if [ "${MY_UID}" != "${ROOTUID}" ] &&
+ [ "${MY_EUID}" != "${ROOTUID}" ] ; then
+ printf "ERROR: The '$0' script must be run as root!\n"
+ exit 255
+fi
+
+
+
+##
+## Define DEFAULT PKI Instances
+##
+
+PKI_DIR="/var/lib"
+
+PKI_CA="pki-ca"
+PKI_DRM="pki-kra"
+PKI_OCSP="pki-ocsp"
+PKI_TKS="pki-tks"
+PKI_RA="pki-ra"
+PKI_TPS="pki-tps"
+
+##
+## NOTE: Always remove "${PKI_CA}" last, as it will most
+## likely host the default Security Domain!
+##
+PKI_INSTANCES="${PKI_TPS} ${PKI_RA} ${PKI_TKS} ${PKI_OCSP} ${PKI_DRM} ${PKI_CA}"
+
+
+
+##
+## Ask user if is is okay to remove ALL DEFAULT PKI instances
+##
+
+printf "REMINDER: PKI instances contain user's PKI data, and consist of\n"
+printf " DEFAULT PKI instances and CUSTOMIZED PKI instances.\n\n"
+printf " DEFAULT PKI instances are automatically created whenever\n"
+printf " one of the PKI subsystems are installed UNLESS that\n"
+printf " particular PKI subsystem's DEFAULT PKI instance\n"
+printf " already exists.\n\n"
+printf " DEFAULT PKI instances consist of the following:\n\n"
+printf " CA - ${PKI_DIR}/${PKI_CA}\n"
+printf " DRM - ${PKI_DIR}/${PKI_DRM}\n"
+printf " OCSP - ${PKI_DIR}/${PKI_OCSP}\n"
+printf " RA - ${PKI_DIR}/${PKI_RA}\n"
+printf " TKS - ${PKI_DIR}/${PKI_TKS}\n"
+printf " TPS - ${PKI_DIR}/${PKI_TPS}\n\n"
+while :
+do
+ printf "This script REMOVES ALL DEFAULT PKI instances! "
+ printf "Is this okay? [yn] "
+ read ANSWER
+ printf "\n"
+ if [ "${ANSWER}" = "Y" ] ||
+ [ "${ANSWER}" = "y" ] ; then
+ printf "\n"
+ break
+ elif [ "${ANSWER}" = "N" ] ||
+ [ "${ANSWER}" = "n" ] ; then
+ printf "\n"
+ printf "No DEFAULT PKI instances will be removed.\n\n"
+ exit 255
+ else
+ continue
+ fi
+done
+
+
+
+##
+## Remove ALL DEFAULT PKI Instances present . . .
+##
+
+INSTANCES=0
+for INSTANCE in ${PKI_INSTANCES} ; do
+ if [ -d "${PKI_DIR}/${INSTANCE}" ] ; then
+ INSTANCES=`expr $INSTANCES + 1`
+ pkiremove -pki_instance_root=${PKI_DIR} -pki_instance_name=${INSTANCE} -force
+ fi
+done
+
+if [ ${INSTANCES} -eq 0 ] ; then
+ printf "No DEFAULT PKI instances need to be removed.\n\n"
+fi
+
+exit 0
+
diff --git a/pki/scripts/remove_pki_components b/pki/scripts/remove_pki_components
new file mode 100755
index 000000000..80569749c
--- /dev/null
+++ b/pki/scripts/remove_pki_components
@@ -0,0 +1,157 @@
+#!/bin/bash
+## BEGIN COPYRIGHT BLOCK
+## (C) 2008 Red Hat, Inc.
+## All rights reserved.
+## END COPYRIGHT BLOCK
+
+## Always switch into this base directory
+## prior to script execution so that all
+## of its output is written to this directory
+
+cd `dirname $0`
+
+
+##
+## This script MUST be run as root!
+##
+
+ROOTUID=0
+
+OS=`uname`
+if [ "${OS}" = "Linux" ] ; then
+ MY_EUID=`/usr/bin/id -u`
+ MY_UID=`/usr/bin/id -ur`
+ USERNAME=`/usr/bin/id -un`
+else
+ printf "ERROR: Unsupported operating system '${OS}'!\n"
+ exit 255
+fi
+
+if [ "${MY_UID}" != "${ROOTUID}" ] &&
+ [ "${MY_EUID}" != "${ROOTUID}" ] ; then
+ printf "ERROR: The '$0' script must be run as root!\n"
+ exit 255
+fi
+
+
+
+##
+## Define DEFAULT PKI Instances
+##
+
+PKI_DIR="/var/lib"
+
+PKI_CA="pki-ca"
+PKI_DRM="pki-kra"
+PKI_OCSP="pki-ocsp"
+PKI_TKS="pki-tks"
+PKI_RA="pki-ra"
+PKI_TPS="pki-tps"
+
+
+
+##
+## Ask user if any PKI instances need to be removed
+##
+
+printf "REMINDER: PKI instances contain user's PKI data, and consist of\n"
+printf " DEFAULT PKI instances and CUSTOMIZED PKI instances.\n\n"
+printf " DEFAULT PKI instances are automatically created whenever\n"
+printf " one of the PKI subsystems are installed UNLESS that\n"
+printf " particular PKI subsystem's DEFAULT PKI instance\n"
+printf " already exists.\n\n"
+printf " DEFAULT PKI instances consist of the following:\n\n"
+printf " CA - ${PKI_DIR}/${PKI_CA}\n"
+printf " DRM - ${PKI_DIR}/${PKI_DRM}\n"
+printf " OCSP - ${PKI_DIR}/${PKI_OCSP}\n"
+printf " RA - ${PKI_DIR}/${PKI_RA}\n"
+printf " TKS - ${PKI_DIR}/${PKI_TKS}\n"
+printf " TPS - ${PKI_DIR}/${PKI_TPS}\n\n"
+printf " Please use the 'remove_default_pki_instances' script\n"
+printf " to remove ALL of these DEFAULT PKI instances, OR\n"
+printf " use the 'pkiremove' utility to remove INDIVIDUAL\n"
+printf " DEFAULT PKI instances.\n\n"
+printf " CUSTOMIZED PKI instances may be named anything and\n"
+printf " may be located anywhere. Please use the 'pkiremove'\n"
+printf " utility to remove any CUSTOMIZED PKI instances.\n\n"
+printf " IMPORTANT: NEITHER CUSTOMIZED PKI instances,\n"
+printf " NOR DEFAULT PKI instances will be\n"
+printf " REMOVED by this script!\n\n"
+while :
+do
+ printf "Do any DEFAULT or CUSTOMIZED PKI instances need to be removed\n"
+ printf "PRIOR to uninstalling ALL of the PKI components? [yn] "
+ read ANSWER
+ printf "\n"
+ if [ "${ANSWER}" = "Y" ] ||
+ [ "${ANSWER}" = "y" ] ; then
+ printf "\n"
+ printf "Please REMOVE the desired CUSTOMIZED and/or DEFAULT\n"
+ printf "PKI instances PRIOR to re-running this script.\n\n"
+ exit 255
+ elif [ "${ANSWER}" = "N" ] ||
+ [ "${ANSWER}" = "n" ] ; then
+ printf "\n"
+ break
+ else
+ continue
+ fi
+done
+
+
+
+##
+## Check for PKI components present on this operating system
+##
+
+printf "Processing PKI components present on system . . . "
+ # (1) grab all PKI components
+ PKI_COMPONENTS=`rpm -qa --queryformat '%{NAME}\n' | grep pki`
+
+ # (2) check for osutil
+ `rpm -q --quiet osutil`
+ OSUTIL_PRESENCE=$?
+ if [ "${OSUTIL_PRESENCE}" = "0" ] ; then
+ PKI_COMPONENTS="${PKI_COMPONENTS} osutil"
+ fi
+
+ # (3) check for symkey (legacy package)
+ `rpm -q --quiet symkey`
+ SYMKEY_PRESENCE=$?
+ if [ "${SYMKEY_PRESENCE}" = "0" ] ; then
+ PKI_COMPONENTS="${PKI_COMPONENTS} symkey"
+ fi
+printf "done.\n\n"
+
+
+
+##
+## Place the PKI components into a list
+##
+
+PKI_COMPONENT_LIST=""
+for COMPONENT in ${PKI_COMPONENTS} ; do
+ if [ "${PKI_COMPONENT_LIST}" = "" ] ; then
+ PKI_COMPONENT_LIST="${COMPONENT}"
+ else
+ PKI_COMPONENT_LIST="${PKI_COMPONENT_LIST} ${COMPONENT}"
+ fi
+done
+
+
+
+##
+## Remove ALL PKI components in the list
+##
+
+if [ "${PKI_COMPONENT_LIST}" != "" ] ; then
+ printf "Removing the following PKI packages:\n"
+ printf " ${PKI_COMPONENT_LIST}\n\n"
+ rpm -ev ${PKI_COMPONENT_LIST}
+ printf "\n"
+else
+ printf "No PKI packages need to be removed.\n\n"
+fi
+
+exit 0
+