set -e doesn't like [ blah ] && blah syntax

changed to if [ blah ]; then blah; fi format
migrated echo usage to cat with HEREDOC to improve readability
This commit is contained in:
Jake Guffey 2012-09-19 17:27:40 -04:00
parent a1793f66ff
commit d77c67b56f

View file

@ -36,6 +36,12 @@ fi
rcvar=$(cat "$__object/explorer/rcvar")
# --state absent, so ensure that .new doesn't exist and that conf is renamed to .old
echo "[ -f \"${rcvar}.new\" ] && rm \"${rcvar}.new\""
echo "[ -f \"${rcvar}\" ] && mv \"${rcvar}\" \"${rcvar}.old\""
cat <<EOF
if [ -f "${rcvar}.new" ]; then
rm "${rcvar}.new"
fi
if [ -f "${rcvar}" ]; then
mv "${rcvar}" "${rcvar}.old"
fi
EOF