If, however, there is just reason to fear the commission of the offense, the person complained of may be required to enter into an undertaking in such sum, not exceeding five thousand dollars, as the magistrate may direct, to keep the peace towards the people of this state, and particularly towards the informer. The undertaking is valid and binding for six months, and may, upon the renewal of the information, be extended for a longer period, or a new undertaking may be required.