mirror of
https://github.com/dockur/windows.git
synced 2026-07-27 21:42:36 +07:00
fix: Warn instead of failing on domain XML updates (#1977)
This commit is contained in:
+23
-23
@@ -798,37 +798,37 @@ updateXML() {
|
|||||||
|
|
||||||
if [ -n "$domain" ]; then
|
if [ -n "$domain" ]; then
|
||||||
|
|
||||||
if ! updateDomain "$asset" "$domain" "$user" \
|
if updateDomain "$asset" "$domain" "$user" \
|
||||||
"$auth_user" "$PASSWORD" "$DOMAIN_OU"; then
|
"$auth_user" "$PASSWORD" "$DOMAIN_OU"; then
|
||||||
error "Failed to add domain configuration to answer file!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! sed -i -E \
|
if ! sed -i -E \
|
||||||
-e '/^[[:space:]]*<LocalAccounts([[:space:]>])/,/^[[:space:]]*<\/LocalAccounts>[[:space:]]*$/d' \
|
-e '/^[[:space:]]*<LocalAccounts([[:space:]>])/,/^[[:space:]]*<\/LocalAccounts>[[:space:]]*$/d' \
|
||||||
-e '/^[[:space:]]*<AdministratorPassword([[:space:]>])/,/^[[:space:]]*<\/AdministratorPassword>[[:space:]]*$/d' \
|
-e '/^[[:space:]]*<AdministratorPassword([[:space:]>])/,/^[[:space:]]*<\/AdministratorPassword>[[:space:]]*$/d' \
|
||||||
"$asset"; then
|
"$asset"; then
|
||||||
error "Failed to remove local account configuration from answer file!"
|
error "Failed to remove local account configuration from answer file!"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! sed -i -E '
|
if ! sed -i -E '
|
||||||
/<SynchronousCommand([[:space:]>])/ {
|
/<SynchronousCommand([[:space:]>])/ {
|
||||||
:command
|
:command
|
||||||
N
|
N
|
||||||
/<\/SynchronousCommand>/!b command
|
/<\/SynchronousCommand>/!b command
|
||||||
/<Description>Password Never Expires<\/Description>/d
|
/<Description>Password Never Expires<\/Description>/d
|
||||||
}
|
}
|
||||||
' "$asset"; then
|
' "$asset"; then
|
||||||
error "Failed to remove local account commands from answer file!"
|
error "Failed to remove local account commands from answer file!"
|
||||||
return 1
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
warn "failed to add domain configuration to answer file!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ -n "$workgroup" ]; then
|
elif [ -n "$workgroup" ]; then
|
||||||
|
|
||||||
if ! updateWorkgroup "$asset" "$workgroup"; then
|
if ! updateWorkgroup "$asset" "$workgroup"; then
|
||||||
error "Failed to add workgroup configuration to answer file!"
|
warn "failed to add workgroup configuration to answer file!"
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user