(code=0)
We may exit the program at any time.
        We want to remove the temp folder and any files contained within it.
        Removes the temp files/folder and exists with error code "code".
We may exit the program at any time.
        We want to remove the temp folder and any files contained within it.
        Removes the temp files/folder and exists with error code "code".
We may exit the program at any time . We want to remove the temp folder and any files contained within it . Removes the temp files / folder and exists with error code code .
def exit_gracefully(code=0):
    """
        We may exit the program at any time.
        We want to remove the temp folder and any files contained within it.
        Removes the temp files/folder and exists with error code "code".
    """
    global RUN_CONFIG
    # Remove temp files and folder
    if os.path.exists(RUN_CONFIG.temp):
        for f in os.listdir(RUN_CONFIG.temp):
            os.remove(RUN_CONFIG.temp + f)
        os.rmdir(RUN_CONFIG.temp)
    # Disable monitor mode if enabled by us
    disable_monitor_mode()
    # Change MAC address back if spoofed
    mac_change_back()
    print GR+" [+]"+W+" quitting" # wifite will now exit"
    print ''
    # GTFO
    exit(code)
def exit_gracefully ( code = 0 ) : global RUN_CONFIG # Remove temp files and folder if os . path . exists ( RUN_CONFIG . temp ) : for f in os . listdir ( RUN_CONFIG . temp ) : os . remove ( RUN_CONFIG . temp + f ) os . rmdir ( RUN_CONFIG . temp ) # Disable monitor mode if enabled by us disable_monitor_mode ( ) # Change MAC address back if spoofed mac_change_back ( ) print GR + " [+]" + W + " quitting" # wifite will now exit" print '' # GTFO exit ( code )