Pulled the function out of the main script to make things look cleaner also added function to generate an inittab