From afb5e6b300079a781249ff66947f2f5c095b194c Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sun, 4 Aug 2013 15:38:37 +0000 Subject: Make msec notifications translatable (bug #10810) --- cron-sh/security.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'cron-sh') diff --git a/cron-sh/security.sh b/cron-sh/security.sh index 199e391..41bcf78 100755 --- a/cron-sh/security.sh +++ b/cron-sh/security.sh @@ -4,17 +4,21 @@ # which should be named NN_script_name.sh, where NN represents # the order in which they should be executed +export TEXTDOMAINDIR=/usr/share/locale +export TEXTDOMAIN=msec +. gettext.sh + if [[ -f /etc/security/msec/security.conf ]]; then # load settings from base level BASE_LEVEL=$(sed -n 's/BASE_LEVEL=//p' /etc/security/msec/security.conf) if [[ ! -f /etc/security/msec/level.$BASE_LEVEL ]]; then - echo "Error: base level $BASE_LEVEL not found" + eval_gettext "Error: base level \$BASE_LEVEL not found"; echo exit 1 fi . /etc/security/msec/level.$BASE_LEVEL . /etc/security/msec/security.conf else - echo "/etc/security/msec/security.conf don't exist." + eval_gettext "/etc/security/msec/security.conf don't exist."; echo exit 1 fi @@ -85,7 +89,7 @@ for script in /usr/share/msec/scripts/*sh; do test -x $script && . $script ret=$? if [ $ret -ne 0 ]; then - echo "MSEC: audit script $script failed" + eval_gettext "MSEC: audit script \$script failed"; echo fi done @@ -120,7 +124,7 @@ if [[ -s ${SECURITY} ]]; then cat ${MSEC_TMP} > ${MAIL_LOG_TODAY} Maillog "[msec] *** Security Check on ${REPORT_HOSTNAME}, ${REPORT_DATE} ***" "${MSEC_TMP}" - Notifylog "MSEC has performed Security Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}. Detailed results are available in ${MAIL_LOG_TODAY}" + Notifylog "`eval_gettext \"MSEC has performed Security Check on \\\${REPORT_HOSTNAME} on \\\${REPORT_DATE}. Detailed results are available in \\\${MAIL_LOG_TODAY}\"`" fi # diff check @@ -131,7 +135,7 @@ if [[ -s ${DIFF} ]]; then echo "$DIFF_PREFIX *** Diff Check, ${REPORT_DATE} ***" >> ${SECURITY_LOG} cat ${DIFF} | sed -e "s/^/$DIFF_PREFIX/g" >> ${SECURITY_LOG} - Notifylog "MSEC has performed Diff Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}. Changes in system security were detected and are available in ${SECURITY_LOG}." + Notifylog "`eval_gettext \"MSEC has performed Diff Check on \\\${REPORT_HOSTNAME} on \\\${REPORT_DATE}. Changes in system security were detected and are available in \\\${SECURITY_LOG}.\"`" fi Maillog "[msec] *** Diff Check on ${REPORT_HOSTNAME}, ${REPORT_DATE} ***" "${DIFF}" -- cgit v1.2.1