DaanHoogland commented on code in PR #6783:
URL: https://github.com/apache/cloudstack/pull/6783#discussion_r1037888028
##########
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
Review Comment:
I don“t mind this part, but just letting the script exit will have all but
the same effect; $? will be the exit code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]