awips2-ldm rpm update should preserve old pqact and ldmd.conf files
This commit is contained in:
parent
673c82fb24
commit
d2caecd999
1 changed files with 6 additions and 4 deletions
|
@ -137,14 +137,15 @@ if [ $? -ne 0 ]; then
|
|||
fi
|
||||
|
||||
%pre
|
||||
DATE=`date -u +%Y%m%d`
|
||||
# Preserve the user etc directory before upgrading
|
||||
if [ -f /awips2/ldm/etc/ldmd.conf ]; then
|
||||
if [ -d /tmp/ldm ]; then
|
||||
rm -rf /tmp/ldm
|
||||
fi
|
||||
mkdir -p /tmp/ldm
|
||||
cp -rp /awips2/ldm/etc/ldmd.conf /tmp/ldm/ldmd.old
|
||||
cp -rp /awips2/ldm/etc/pqact.conf /tmp/ldm/pqact.old
|
||||
cp -rp /awips2/ldm/etc/ldmd.conf /tmp/ldm/ldmd.${DATE}
|
||||
cp -rp /awips2/ldm/etc/pqact.conf /tmp/ldm/pqact.${DATE}
|
||||
fi
|
||||
|
||||
%post
|
||||
|
@ -289,8 +290,9 @@ else
|
|||
fi
|
||||
|
||||
# Copy back local ldm
|
||||
if [ -d /tmp/ldm ]; then
|
||||
cp -rp /tmp/ldm /awips2/ldm/etc
|
||||
if [ -d /tmp/ldm/ ]; then
|
||||
cp -rp /tmp/ldm/pqact.* /awips2/ldm/etc/
|
||||
cp -rp /tmp/ldm/ldmd.* /awips2/ldm/etc/
|
||||
fi
|
||||
|
||||
%preun
|
||||
|
|
Loading…
Add table
Reference in a new issue