For a more simplistic approach Ubuntu 14 has the pulseaudio volume control that allowed me to switch the audio back to analog from hdmi fixing the issue without the command script.
For a more simplistic approach Ubuntu 14 has the pulseaudio volume control that allowed me to switch the audio back to analog from hdmi fixing the issue without the command script.