I have a dual boot machine (windows/ubuntu) and I need to automate the toggle between them, so first I need to check on which OS am I right now in programmatic way (background: there will be 2 different tasks that will reach the machine from remote, each designed for their specific OS - linux or windows - and so I'll need to restart accordingly).
Is there a good way to do so other then look for a predefined anchor file/path ?