Skip to content

Commit 96aaeac

Browse files
RodrigoDLopezLopez
andauthored
Fixes script that perform change password on hosts (#6783)
Co-authored-by: Lopez <rodrigo@scclouds.com.br>
1 parent 239e9dd commit 96aaeac

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/vm/hypervisor/update_host_passwd.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515
# KIND, either express or implied. See the License for the
1616
# specific language governing permissions and limitations
1717
# under the License.
18-
1918
username=$1
2019
new_passwd=$2
21-
expected="successfully."
22-
result=`echo -e "$new_passwd\n$new_passwd" | passwd --stdin $username | grep successfully | awk '{ print $6 }'`
2320

24-
if [ $result = $expected ]; then
21+
passwd ${username} << EOD
22+
${new_passwd}
23+
${new_passwd}
24+
EOD
25+
26+
if [[ $(echo $?) -eq 0 ]]; then
2527
exit 0
2628
else
2729
exit 1
28-
fi
30+
fi

0 commit comments

Comments
 (0)