It is narrated from Imam Sadeq (AS) who said:
Whoever is happy to be one of the followers of Imam Mahdi (AJ) must wait and whilst waiting behave morally and remain a devout person [1]. It is also narrated from Imam Mahdi (AJ) who said: So, each and every one of you, must adopt acts that causes our friendship with you, and avoid any act which causes our displeasure; because our command will occur suddenly and at that time repenting and return is of no use to anyone, and being regretful of the sins, saves no one [2].
[1] Qaibat-e-Nua’mani, Page 200, Hadith 16; Beharul Anwaar, Vol. 52, Page 140, Bab 22.
[2] Al-Ihtijaj, Tabarsi, Vol. 2, Page 599; Beharul Anwaar, Majlesi, Vol. 53, Page 176.
Source: en.shafaqna.com