Thomas Ackermann a écrit : > As older postfix installations have a "fallback_relay" variable and > newer installations have a "smtp_fallback_relay", i wanted to use > postconf to check, which version is supported. > > Usally, i would expect a program to return with a non-zero exit-code at > such a failure: > > r...@localhost# postconf fallback_relay > postconf: warning: fallback_relay: unknown parameter > > r...@localhost## echo $? > 0 > > > So, any chance of getting a non-zero return code for errors like > "unknown parameter"? > Would be great for scripting ...
check_parameter() { postconf $1 2>&1 | grep -vq "unknown parameter" return $? } or check_parameter() { postconf $1 2>/dev/null | grep -q = return $? }