<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(data_dir):
 """Update NLPIR license."""

    try:
        license_updated = update_license_file(data_dir)
    except URLError:
        click.secho('Error: unable to fetch newest license.', fg='red')
        exit(1)
    except (IOError, OSError):
        click.secho('Error: unable to move license to data directory.',
                    fg='red')
        exit(1)

    if license_updated:
        click.echo('License updated.')
    else:
        click.echo('Your license is already up-to-date.')