#!/usr/bin/python -tt

import fileinput
import os.path
import shutil

if __name__ == '__main__':
    ssh_dir = os.path.dirname(__file__)
    conf_d_dir = os.path.join(ssh_dir, 'config.d')
    conf_d_filenames = os.listdir(conf_d_dir)

    with open(os.path.join(ssh_dir, 'config'), 'w') as dest_config:
        for conf_d_filename in sorted(os.listdir(conf_d_dir)):
            dest_config.write('# file:{0}\n'.format(conf_d_filename))
            with open(os.path.join(conf_d_dir, conf_d_filename)) as src_config:
                shutil.copyfileobj(src_config, dest_config)
