mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fixes script that perform change password on hosts (#6783)
Co-authored-by: Lopez <rodrigo@scclouds.com.br>
This commit is contained in:
parent
239e9dd861
commit
96aaeac2a0
@ -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
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user