Mercurial > trustbridge
diff packaging/linux-installer.inc.in @ 723:e71c59b16eee
Added certificate deinstallation.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Wed, 02 Jul 2014 16:19:18 +0200 |
parents | acbe75423283 |
children | d280e2d39d5a |
line wrap: on
line diff
--- a/packaging/linux-installer.inc.in Wed Jul 02 15:12:25 2014 +0200 +++ b/packaging/linux-installer.inc.in Wed Jul 02 16:19:18 2014 +0200 @@ -13,7 +13,7 @@ BINNAMES="###BINNAMES###" declare -A instcfg oldinstcfg -declare inst_default_prefix instcfg_file +declare inst_default_prefix instcfg_path instcfg_file instcfg=( [TIMESTMP]=`date -u +%Y%m%d%H%M%S` [VERSION]='@PROJECT_VERSION@' @@ -133,11 +133,13 @@ { if [ $SYSINST -eq 1 ] ; then inst_default_prefix="$SYSDEFAULT_PREFIX" - instcfg_file="${SYSCFGPATH}/${INSTCFGNAME}" + instcfg_path="${SYSCFGPATH}" + else inst_default_prefix="$DEFAULT_PREFIX" - instcfg_file="${CFGPATH}/${INSTCFGNAME}" + instcfg_path="${CFGPATH}" fi + instcfg_file="${instcfg_path}/${INSTCFGNAME}" } write_instcfg() @@ -166,11 +168,31 @@ fi } +deinstall_certs() +{ + local cinst="${oldinstcfg[PREFIX]}/bin/cinst" + local certlist=`ls -1 ${instcfg_path}/list-*.txt | sort -nr | head -n 1` + + echo "Uninstalling certificates ..." + + if [ "$certlist" ] ; then + echo "Using certificate list '$certlist'." + if [ -x $cinst ] ; then + "$cinst" "list=$certlist" "choices=uninstall" + else + echo >&2 "WARNING: can't execute $cinst for certificate deinstallation." + fi + else + echo "No certificate list found. Nothing to do." + fi +} + deinstall() { if [ "${oldinstcfg[PREFIX]}" ] ; then echo "Really deinstall TrustBridge from '${oldinstcfg[PREFIX]}'?" yorn || exit 0 + deinstall_certs local deinstdir="${oldinstcfg[PREFIX]}/bin" echo "Deinstalling from '${oldinstcfg[PREFIX]}'." for file in $BINNAMES ; do