Automatic AP startup using hostapd

Hi

How can I make hostapd to run on startup using Intel 8265 wifi specified for jetson nano

import subprocess
import os
import time

while True:
    time.sleep(1)
    result = subprocess.run(['lsusb'], stdout=subprocess.PIPE)
    print(result.stdout)
    
    if ("Realtek RTL8188CUS" in str(result.stdout)):
        time.sleep(3)
        os.system("sudo create_ap wlan0 eth0 'YourDesiredSsidHere' 'YourWiFiKeyHere' --freq-band 2.4 --no-virt -w 2")
        
        break

NOTE: I used this sample code jetson access point

Sorry for the late response, has issue been resolved or still need support?

Thanks

Yes, I still need support, also I would like to know how to bridge the internet. This is so it doesn’t just create an AP but also passes internet through. Thanks