def create_starter_script(user, is_master):
    """
    Create starter bash script.
    """
    template = [
        '#!/bin/bash',
        '',
        'source /home/{}/.ros/env/distributed_ros.bash'.format(user),
        'rosrun distributed_system_upstart distributed_ros_{}'.format('master' if is_master else 'slave'),
    ]
    return '\n'.join(template)