#!/bin/bash
echo Please enter the new password for HP HMMO administrator:
read -sr pass1
[ $? = 0 ] && {
   echo Please reenter the password:
   read -sr pass2
   if [ $? = 0 ] && [ "$pass1" = "$pass2" ]; then
      /opt/compaq/cpqacuxe/bld/hpwebsetup -pA:`echo $pass1 | sed -e 's/\"/\\\"/g'` -f &>/dev/null 
      if [ $? = 6 ]; then
         echo HP HMMO administrator password has been changed successfuly.
         exit 0
      else
         echo Failed to change HP HMMO administrator password.
         exit 1
      fi
   else
      echo Reentered password not matching or reading error. No change has been made.
      exit 1
   fi
}
