If there is good reason to fear the commission of the crime, the person complained of may be required to enter into an undertaking in a sum not exceeding $2,000 as the judge or magistrate may direct, with one or more sufficient sureties, to keep the peace toward the people of the state and particularly toward the complainant. The undertaking is valid and binding for not more than one year and may, upon the renewal of the action, be extended for an additional period of not more than one year, or a new undertaking required.