A justice of the peace shall have the power to punish by fine not exceeding $100, or by imprisonment not exceeding 170 days, any disobedience or resistance to his or her lawful writ, process, order or rule.
Any disobedience or resistance to the lawful writ, process, order or rule of a justice of the peace shall be punished as a civil contempt only, and any person imprisoned for such disobedience or resistance shall be discharged from such imprisonment upon satisfying the justice that he or she has obeyed the writ, process, order or rule, or is prepared to do so.