def get_shell_from_file(shellname):
    """
    Returns the shell from a .shell file in the shell directory as a string. It
    can then be formatted to place ip and port in the file.
    """
    filecontents = None
    with open('shells/{}.shell'.format(shellname), 'r') as f:
        filecontents = f.read()
    return filecontents