The config-mod commands generates an error if it does not change
anything:
$ ipa config-mod --ipaselinuxusermap="....."
ipa: ERROR: no modifications to be performed
As for real errors, the return code is 1, so this cannot be used
to detect "nothing to be done" errors.
This makes it very inconvenient to write scripts that overwrite a
value and do not care what the current value is. Is there an easy
way to suppress this kind of errors?
I could do something like
{ ipa config-mod ... 2>&1 && echo && echo succes; } |
grep -qE "(success)|(no modifications to be performed)"
but that's really ugly and depends on the exact wording and
language of the error message.
(This is also a problem for other "add" commands like user-add,
group-add, selinuxusermap-add etc.)
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt