awips2/deltaScripts/11.9.0-4/edex/removeSampleId.sh
root 8e80217e59 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 3360eb6c5f
2012-01-06 08:55:05 -06:00

22 lines
934 B
Bash
Executable file

#!/bin/bash
# Script to remove sampleId tags from sample sets
if [ -d /awips2/edex/data/utility/common_static ]; then
if [ "$1" == "removeBak" ]; then
for bak in `ls -1 /awips2/edex/data/utility/common_static/*/*/gfe/sampleSets/*.xml.bk$`; do
echo "Removing $bak"
rm $bak
done
else
for ss in `ls -1 /awips2/edex/data/utility/common_static/*/*/gfe/sampleSets/*.xml`; do
echo "Editing $ss..."
sed -i.bk$ -e 's/<sampleId.*\/>//' $ss
done
echo
echo " Update complete. Please verify you sample sets are still loading correctly."
echo " If you find an issue you can restore your previous version from the file with the .bk$ extension"
echo " and manually remove the <sampleId .../> tag."
echo " Once you have verified all your sample sets are ok rerun this script with removeBak to remove the .bk$ files"
echo " Example:"
echo " $0 removeBak"
fi
fi