diff --git a/src/answer.sh b/src/answer.sh index 068cb3e9..2a58f77e 100644 --- a/src/answer.sh +++ b/src/answer.sh @@ -798,37 +798,37 @@ updateXML() { if [ -n "$domain" ]; then - if ! updateDomain "$asset" "$domain" "$user" \ + if updateDomain "$asset" "$domain" "$user" \ "$auth_user" "$PASSWORD" "$DOMAIN_OU"; then - error "Failed to add domain configuration to answer file!" - return 1 - fi - if ! sed -i -E \ - -e '/^[[:space:]]*])/,/^[[:space:]]*<\/LocalAccounts>[[:space:]]*$/d' \ - -e '/^[[:space:]]*])/,/^[[:space:]]*<\/AdministratorPassword>[[:space:]]*$/d' \ - "$asset"; then - error "Failed to remove local account configuration from answer file!" - return 1 - fi + if ! sed -i -E \ + -e '/^[[:space:]]*])/,/^[[:space:]]*<\/LocalAccounts>[[:space:]]*$/d' \ + -e '/^[[:space:]]*])/,/^[[:space:]]*<\/AdministratorPassword>[[:space:]]*$/d' \ + "$asset"; then + error "Failed to remove local account configuration from answer file!" + return 1 + fi - if ! sed -i -E ' - /])/ { - :command - N - /<\/SynchronousCommand>/!b command - /Password Never Expires<\/Description>/d - } - ' "$asset"; then - error "Failed to remove local account commands from answer file!" - return 1 + if ! sed -i -E ' + /])/ { + :command + N + /<\/SynchronousCommand>/!b command + /Password Never Expires<\/Description>/d + } + ' "$asset"; then + error "Failed to remove local account commands from answer file!" + return 1 + fi + + else + warn "failed to add domain configuration to answer file!" fi elif [ -n "$workgroup" ]; then if ! updateWorkgroup "$asset" "$workgroup"; then - error "Failed to add workgroup configuration to answer file!" - return 1 + warn "failed to add workgroup configuration to answer file!" fi fi