1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#!/bin/bash
# This file is actually used to create and to remove entries from a
# policy. It automatically removes old versions, and if there is a new
# one, it installs it. This allows the system to remove the "best" one
# and have it pick the second-best, if installed.
# Variables
ASSEMBLY=$1
VERSION=$2
COMBINED="$VERSION.$ASSEMBLY"
POLICY="policy.$VERSION.$ASSEMBLY"
# Remove the old policy, if we have one installed
if [ -f /usr/share/cli-common/packages.d/$POLICY.installcligac ]; then
/usr/share/cli-common/gac-package-remove $POLICY > /dev/null
rm -f /usr/share/cli-common/packages.d/$POLICY.installcligac
fi
# Choose the correct one
for file in $(ls /usr/share/cli-common/policies.d/???-$COMBINED \
2>/dev/null | sort -rn)
do
# Copy this one as a installcligac
cp $file /usr/share/cli-common/packages.d/$POLICY.installcligac
# Install it
/usr/share/cli-common/gac-package-install $POLICY > /dev/null
# We just deal with the one
exit
done
|