In all actions in which the right to real or personal estate is in controversy, the court or the judge thereof shall make an order for the protection of the property in controversy from waste or destruction, and to prevent the removal of personal property beyond the jurisdiction of the court, upon satisfactory proof being made of the necessity for such order, and may enforce such order by an attachment for contempt and other proper process; but in all such cases the court or judge may require a bond of the party applying for the order, in an adequate penalty, payable to the opposite party, with sufficient sureties, to be approved by the court or judge, conditioned to pay all such damages as may be suffered by reason of such order in case the principal obligor be cast in the suit.