Change button icon based on network adapter status

I made two simple buttons inside a menu button to disable and enable the network adaptor:

dopus_vlRLjjn2De

Disable:

netsh interface set interface Ethernet disable

Enable:

netsh interface set interface Ethernet enable

Is there a way to have the parent button's icon change based on whether the network adapter is enabled or disabled?

You could do it using a variable and then update the value of that variable in each command. Would run the risk of getting out of sync though.

Yes, that's a workaround that if it got out of sync, it would show the opposite icon. Is there any line of code that we can add so that Opus can check if the adaptor is enabled or disabled?