From 923d807ef866fc23656708588e5a04644f178f36 Mon Sep 17 00:00:00 2001 From: Thomas Mayer Date: Sun, 29 Mar 2015 18:18:30 +0200 Subject: [PATCH] use human-readable variable names (issue #1003) --- config/action.d/mail-whois-common.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/action.d/mail-whois-common.conf b/config/action.d/mail-whois-common.conf index 1da54286e..b0d27afc3 100644 --- a/config/action.d/mail-whois-common.conf +++ b/config/action.d/mail-whois-common.conf @@ -15,9 +15,10 @@ _whois = whois || echo "missing whois program" # use heuristics to convert charset of whois output to a target # character set before sending it to a mail program +# make sure you have 'file' and 'iconv' commands installed when opting for that _whois_target_charset = UTF-8 _whois_convert_charset = whois | - { c=$(cat) ; cs=$(printf %%b "$c" | file -b --mime-encoding -) ; printf %%b "$c" | iconv -f $cs -t %(_whois_target_charset)s//TRANSLIT - ; } + { WHOIS_OUTPUT=$(cat) ; WHOIS_CHARSET=$(printf %%b "$WHOIS_OUTPUT" | file -b --mime-encoding -) ; printf %%b "$WHOIS_OUTPUT" | iconv -f $WHOIS_CHARSET -t %(_whois_target_charset)s//TRANSLIT - ; } # choose between _whois and _whois_convert_charset in mail-whois-common.local # or other *.local which include mail-whois-common.conf.