We are grepping the wrong string here.

The string `'/usr/local/bin/hostapd'` should be `'/usr/sbin/hostapd'`

The hostapd swicht will work correctly now.