Automatic su password entry script

Before I start, two things.

1) Yes I know it's bad practice and obomination to all things holy, but I'm not a sys admin at JP Morgan, I'm a hobbyist tooling about in a VM, in my pants, at home.

2) If you are just going to flame for even considering hardcoding a root password, thanks, I get it.

So here goes.
I have the following script:

#!/bin/bash
clear
echo
whoami
echo
PASS="1234"
expect -c "spawn su
expect -nocase \"password:\" {send \"$PASS\r\" ; interact ; whoami }"
#Scripts exits at this point
echo -ne "Name: "
read name
echo
echo $name

It works fine in that it enters the password and elevates the privileges of the user.
The problem is that it then exits at the marked point and does not continue to the code below.
Any ideas why this is?

Running Backbox 64 Bit in VMPlayer

su doesn't change the user of your shell, it runs a new shell, reading from standard input. If you want it to run any particular text you'll have to feed that text into it, it won't automatically read lines from some other shell.

If this is your own hobby machine, you can install sudo and enable it for everyone in the wheel group with the NOPASSWD option. Using expect when you don't have to is like this.

Haha, ok cool. Cheers dude.