Date comparison script

hi,

I have a file named user.cfg under /var/member/

 
#user.cfg file under /var/member/
login user: root #how are you
login pass: admin #where are you
M: user1 pass1 #20121008
M: user2 pass2 #20111230
M: user3 pass3 #20091220
M: user4 pass4 #20070210
M: user5 pass5 #20130708
M: user6 pass6 #20141008
M: user7 pass7 #20101008
.
.
.
.
M: user90 pass90 #20121222
M: user91 pass91 #20121227
M: user92 pass92 #20131102
M: user93 pass93 #20120809

What I would like to do is to have a script to read user.cfg file, it will search each line only starting with "M:" and find # sign in each line, then will check expired dates.
If the date is expired, the script shall remove related lines and will save by overwriting the existing user.cfg file.

So the output of user.cfg should be :

 
#user.cfg file under /var/member/
login user: root #how are you
login pass: admin #where are you
M: user5 pass1 #20130708
M: user6 pass1 #20141008
.
.
.
.
M: user90 pass90 #20121222
M: user91 pass91 #20121227
M: user92 pass92 #20131102

I have read some other threads about date comparison but none of them exactly the same with my user.cfg file.

Thanks in advance
Baris35

 
$ nawk -F\# -v d=$(date +%Y%m%d) '!/^M/{print;next}{if($NF>d)print}' /var/member/user.cfg
#user.cfg file under /var/member/
login user: root #how are you
login pass: admin #where are you
M: user5 pass5 #20130708
M: user6 pass6 #20141008
.
.
.
.
M: user90 pass90 #20121222
M: user91 pass91 #20121227
M: user92 pass92 #20131102

Its the same question here:

And as I write, if its CCcam, do NOT remove the line, it only fills the log, change cards to 0 by use F: user pass 0 0 0 { 0:0:0 }

Thanks for your reply Jotne,
I was not knowing what was Ccccam until I saw your reply. The strange is thing that our samples have resemblance. Unable to manage complicated things shown in your thread and itkamaraj's answer is enough for me.
Problem has been solved by means of your valuable help.
The thread would be locked/closed if it is possible.

Thanks million times again&again.
Baris35