Your awk is correct, however you are redirected to the same file as your original. This causes the source file to be overwritten before it is read. You will need to redirect the output to another file.
awk '/e2/{gsub(/off/, "on")};{print}' ~/Documents/Prueba > ~/Documents/Prueba.new
Rename Prueba.new after that, if necessary.
source share