Sets the time at which the account expires (in seconds since the UNIX
    epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on
    FreeBSD.

    A value of ``0`` sets the account to never expire.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_expire username 1419980400

def set_expire(name, expire):
    '''
    Sets the time at which the account expires (in seconds since the UNIX
    epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on
    FreeBSD.

    A value of ``0`` sets the account to never expire.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_expire username 1419980400
    '''
    pre_info = info(name)
    if expire == pre_info['expire']:
        return True
    if __grains__['kernel'] == 'FreeBSD':
        cmd = ['pw', 'user', 'mod', name, '-e', expire]
    else:
        cmd = ['usermod', '-e', expire, name]
    __salt__['cmd.run'](cmd, python_shell=False)
    post_info = info(name)
    if post_info['expire'] != pre_info['expire']:
        return post_info['expire'] == expire