diff --git a/scripts/vm/hypervisor/update_host_passwd.sh b/scripts/vm/hypervisor/update_host_passwd.sh index 9dfc5a900f1..f1e469ccaec 100755 --- a/scripts/vm/hypervisor/update_host_passwd.sh +++ b/scripts/vm/hypervisor/update_host_passwd.sh @@ -15,14 +15,16 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - username=$1 new_passwd=$2 -expected="successfully." -result=`echo -e "$new_passwd\n$new_passwd" | passwd --stdin $username | grep successfully | awk '{ print $6 }'` -if [ $result = $expected ]; then +passwd ${username} << EOD +${new_passwd} +${new_passwd} +EOD + +if [[ $(echo $?) -eq 0 ]]; then exit 0 else exit 1 -fi \ No newline at end of file +fi