Untested device activation code

The bridge script contains my best effort at device activation, but without the keys I can't test it.