mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: cylinder/Allrun: keep backup separate
This commit is contained in:
@ -12,24 +12,18 @@ application=`getApplication`
|
|||||||
MAIN_CONTROL_DICT=`foamEtcFile controlDict`
|
MAIN_CONTROL_DICT=`foamEtcFile controlDict`
|
||||||
if [ -f "$MAIN_CONTROL_DICT" ]
|
if [ -f "$MAIN_CONTROL_DICT" ]
|
||||||
then
|
then
|
||||||
echo "Modifying ${MAIN_CONTROL_DICT}"
|
echo "Modifying ${MAIN_CONTROL_DICT} to enable allowSystemOperations"
|
||||||
if [ -e ${MAIN_CONTROL_DICT}.org ]
|
|
||||||
then
|
|
||||||
echo "File ${MAIN_CONTROL_DICT}.org already exists"
|
|
||||||
echo "Did Allrun fail in some way and then run again?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Clean up on termination and on Ctrl-C
|
# Clean up on termination and on Ctrl-C
|
||||||
trap 'mv ${MAIN_CONTROL_DICT}.org ${MAIN_CONTROL_DICT} 2>/dev/null; exit 0' \
|
trap 'mv ${MAIN_CONTROL_DICT}.$$ ${MAIN_CONTROL_DICT} 2>/dev/null; exit 0' \
|
||||||
EXIT TERM INT
|
EXIT TERM INT
|
||||||
cp ${MAIN_CONTROL_DICT} ${MAIN_CONTROL_DICT}.org
|
cp ${MAIN_CONTROL_DICT} ${MAIN_CONTROL_DICT}.$$
|
||||||
|
|
||||||
echo "Enabling allowSystemOperations in ${MAIN_CONTROL_DICT}."
|
echo "Enabling allowSystemOperations in ${MAIN_CONTROL_DICT}."
|
||||||
|
|
||||||
sed \
|
sed \
|
||||||
-e s/"\(allowSystemOperations[ \t]*\)\([0-9]\);"/"\1 1;"/g \
|
-e s/"\(allowSystemOperations[ \t]*\)\([0-9]\);"/"\1 1;"/g \
|
||||||
${MAIN_CONTROL_DICT}.org > ${MAIN_CONTROL_DICT}
|
${MAIN_CONTROL_DICT}.$$ > ${MAIN_CONTROL_DICT}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -r 0.org 0 > /dev/null 2>&1
|
cp -r 0.org 0 > /dev/null 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user