Adding the realmd script

This is the first version of the realmd script. It's my first script so it's pretty possible there are mistakes.