mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +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
|
# KIND, either express or implied. See the License for the
|
||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
username=$1
|
username=$1
|
||||||
new_passwd=$2
|
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
|
exit 0
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user