There is another alternative, but I don't know if will works. You need to try
################################
#!/bin/bash
var="$(cat <<EOF
restore before=\"2017-01-30 08:00:00\" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 select all done yes
3
EOF
)"
echo "$var" | /usr/bin/bconsole
Best Regards