awips2/rpms/awips2.ade/tar.ade/scripts/ade_quick_uninstall.sh
Bryan Kowal d537df4ab0 Issue #202 - restoring rpm directory to ss_sync.
Former-commit-id: ea1c82452b [formerly 65e1e4ee0b [formerly 56068aa96fa6daf113861476bf4b7aebe2021ca4]]
Former-commit-id: 65e1e4ee0b
Former-commit-id: 4453ad2d10
2012-01-20 13:38:00 -06:00

29 lines
650 B
Bash

#!/bin/bash
# This script must be run as root or with root privileges.
if [ ! "${USER}" = "root" ]; then
echo "ERROR: You Must Be 'root' To Run This Script."
echo "Unable To Continue ... Terminating."
exit 1
fi
function removeRPMNoMatterWhat()
{
# Arguments:
# $1 == the component name
AWIPSII_COMPONENT="${1}"
rpm -e --nodeps ${AWIPSII_COMPONENT}
RC="$?"
if [ ! "${RC}" = "0" ]; then
echo "ERROR: Unable To Remove '${AWIPSII_COMPONENT}'."
fi
}
ADE_COMPONENTS=`rpm -qa --queryformat='%{NAME}\n' |grep awips2 | sort -n`
for component in ${ADE_COMPONENTS[*]};
do
removeRPMNoMatterWhat "${component}"
done