]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Masking RHSM password in logging output of snippet
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 30 May 2024 10:01:43 +0000 (12:01 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 30 May 2024 10:01:43 +0000 (12:01 +0200)
snippets/tpl.110.register-rhel.sh

index 2a18e1b13ca5040e38667dc47a15f3eaf6d046bb..d789871a2a8bf16d561b2b9c3c306b010a6f8bdc 100644 (file)
@@ -14,14 +14,16 @@ register_rhel() {
     local err_msg=
     local fqdn=$( hostname -f )
     local cmd="${rhsm} register --no-progress-messages --username '${rhsm_user}' --password '${rhsm_pwd}' "
+    local cmd_out="${rhsm} register --no-progress-messages --username '${rhsm_user}' --password '********' "
     cmd+="--auto-attach --name '${fqdn}'"
+    cmd_out+="--auto-attach --name '${fqdn}'"
 
     if [[ -z "${rhsm_user}" || -z "${rhsm_pwd}" ]] ; then
         err_msg="Either RHSM_USER or RHSM_PWD are not defined as meta variables."
     else
         if [[ -x "${rhsm}" ]] ; then
             echo
-            echo "Executing: ${cmd}"
+            echo "Executing: ${cmd_out}"
             if [[ -n "${rhsm_system_id}" ]] ; then
                 if eval ${cmd} --consumerid "${rhsm_system_id}" ; then
                     rhsm_registred='y'