Very much proof-of-concept prototype do not try this at home etc etc but
https://pixelhero.dev/tmp/netmanager.tar <- source is there.
It's trivial, in the most literal sense of the word. 90 lines of code for the whole thing.
Making it robust, actually handling wifi, and any other features I can think of will still probably leave it under 1KLoC when it's finished. It's -not- a hard problem.