The perfecting of an appeal shall not stay enforcement of a right to attach order unless an undertaking is given. The undertaking shall be in the amount specified in the right to attach order as the amount to be secured by the attachment. The undertaking shall be on condition that if the right to attach order is not reversed and the plaintiff recovers judgment in the action in which the right to attach order was issued, the appellant shall pay the amount of the judgment, together with any interest which may have accrued. The liability on the undertaking may be enforced if the judgment is not paid within 30 days after it becomes final. If a surety on the undertaking pays the judgment, either with or without action, the surety is substituted to the rights of the creditor and is entitled to control, enforce, and satisfy the judgment, in all respects as if the surety had recovered the judgment.