FIX 1356899

Re-propose reverted branch 2d129e3 (manual provision with custom key).
Re-add a line of bash script that was accidentally deleted.