aboutsummaryrefslogtreecommitdiffstats
path: root/cron-sh
diff options
context:
space:
mode:
authorYuri Chornoivan <yurchor@mageia.org>2013-08-04 15:38:37 +0000
committerYuri Chornoivan <yurchor@mageia.org>2013-08-04 15:38:37 +0000
commitafb5e6b300079a781249ff66947f2f5c095b194c (patch)
tree8b6de9eefbdc97ffbf6f56d2ff877b52d94892de /cron-sh
parent2b8764d8c899b2d8ad1a99415fa1660155ff6163 (diff)
downloadmsec-afb5e6b300079a781249ff66947f2f5c095b194c.tar
msec-afb5e6b300079a781249ff66947f2f5c095b194c.tar.gz
msec-afb5e6b300079a781249ff66947f2f5c095b194c.tar.bz2
msec-afb5e6b300079a781249ff66947f2f5c095b194c.tar.xz
msec-afb5e6b300079a781249ff66947f2f5c095b194c.zip
Make msec notifications translatable (bug #10810)
Diffstat (limited to 'cron-sh')
-rwxr-xr-xcron-sh/security.sh14
1 files changed, 9 insertions, 5 deletions
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}"