title: Bash if failed return to previous command
body: <p>I have a script that mounts a windows share and I worked on it to learn bash scripting.</p>
  
  <p>The problem I am facing is that there is a result written in zenity as once the share is mounted it gives out <strong>OK</strong> when it fails to mount it gives out <strong>FAIL</strong>.</p>
  
  <p>Now I want to ask user his password one more time if the output was <strong>FAIL</strong> so if she/he had a mistake in the password she/he can rewrite it.</p>
  
  <p><strong>Input</strong></p>
  
  <pre><code>## define a function that launched the zenity username dialog
  get_password(){
      zenity --entry --width=300 --title="Mount $MOUNTDIR" --text="Password:" --hide-text
  }
  
  # attempt to get the password and exit if cancel was pressed
  wPassword=$(get_password) || exit
  
  # if the username is empty or matches only whitespace.
  while [ "$(expr match "$wPassword" '.')" -lt "1" ]; do
      zenity --error --title="Error in password!" --text="Please check your password! Password field can not be empty!" || exit
      wPassword=$(get_password) || exit
  done
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code># show if mounting was OK or failed
  if [ $? -eq 0 ]; then
          zenity --info --title="Mounting public share succeeded!" --text="Location Documents/Shares/public!"
  else
          zenity --error --title="Mounting public did not succeed!" --text="Please contact system administrator!"
  fi
  </code></pre>
  
  <p>So I need the script to rerun <strong>input</strong> if output was a <strong>fail</strong>. I hope you understand what I need.</p>