MT#5427 Add -f flag to force update.

vseva/5635
Andreas Granig 12 years ago
parent 7c6cb583cf
commit 585191263d

@ -7,6 +7,27 @@ verbose() {
fi fi
} }
usage() {
echo -e "Usage: $0 [OPTION]..." 1>&2
echo -e "\t-f: Force update, even if running on active node" 1>&2
exit 1
}
FORCE_ACTIVE_NODE=false
while getopts "f" opt; do
case "${opt}" in
f)
FORCE_ACTIVE_NODE=true
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
# do not rely on hostname(1), might return hostname of the # do not rely on hostname(1), might return hostname of the
# deployment system when initially deploying via chroot # deployment system when initially deploying via chroot
if [ -r /etc/hostname ] ; then if [ -r /etc/hostname ] ; then
@ -181,7 +202,11 @@ revision_wrapper() {
;; ;;
*) *)
if $ACTIVE_NODE ; then if $ACTIVE_NODE ; then
if $FORCE_ACTIVE_NODE; then
revlist="$revlist $(basename $rev)"
else
echo "Replication script ${revname} noted, nothing to do on active node" echo "Replication script ${revname} noted, nothing to do on active node"
fi
else else
revlist="$revlist $(basename $rev)" revlist="$revlist $(basename $rev)"
fi fi

Loading…
Cancel
Save