Connect existing image texture to material output

Hello Devs, Here is my scene. I am actually trying to bake lighting/texture for my object

I needed to add image texture to all existing materials on my object then bake (the code in the image). I then removed unused nodes (hence only one material remaining in the scene)

Alt that is left is to connect the image texture to the output. Please what lines of code do I put after “bpy.ops.object.bake()” to make that happen?

links = mat.node_tree.links
link =[0], mat.node_tree.nodes.get("Material Output").inputs[0])