This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 96aaeac2a00 Fixes script that perform change password on hosts (#6783)
96aaeac2a00 is described below

commit 96aaeac2a00986682aee287e642772d2b0b69990
Author: Rodrigo D. Lopez <[email protected]>
AuthorDate: Fri Dec 16 13:21:44 2022 -0300

    Fixes script that perform change password on hosts (#6783)
    
    Co-authored-by: Lopez <[email protected]>
---
 scripts/vm/hypervisor/update_host_passwd.sh | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

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

Reply via email to