How to Programatically change the Wifi settings in Arduino Yun from Linino

Hi,

I'm a newbe to Linux and Python.

Do you know if it would be possible to:
A) Perform a WIFI reset programatically (equivalent to the 5 seconds press on the reset button)?

B) Get the yun into access point mode so that I can enter credentials for a new WIFI network (without loosing previously entered credentials)?

Ideally I would use Python as much as possible.

Thanks and Regards,

Bertil