summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2011-06-20 10:57:58 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2011-06-20 10:57:58 +0200
commit859c130bf6e1ad927b32068162b07b510599990e (patch)
tree2255318ce548b0bef91db914db331221e2d00a1a
parentcb236213d7b7336f11595e8d5c7d53d03df06493 (diff)
downloadabrt-859c130bf6e1ad927b32068162b07b510599990e.tar.gz
abrt-859c130bf6e1ad927b32068162b07b510599990e.tar.xz
abrt-859c130bf6e1ad927b32068162b07b510599990e.zip
remove bashism from ccpp-hook
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
-rwxr-xr-xsrc/hooks/abrt-install-ccpp-hook.in13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/hooks/abrt-install-ccpp-hook.in b/src/hooks/abrt-install-ccpp-hook.in
index 9c7df750..b5fac3d9 100755
--- a/src/hooks/abrt-install-ccpp-hook.in
+++ b/src/hooks/abrt-install-ccpp-hook.in
@@ -8,12 +8,17 @@ verbose=false
DEFAULT_LOCATION=/var/spool/abrt
-DUMP_LOCATION=`cat @sysconfdir@/abrt/abrt.conf | grep '^[ ]*DumpLocation'`
-DUMP_LOCATION=${DUMP_LOCATION#*DumpLocation*=}
-DUMP_LOCATION=${DUMP_LOCATION// /}
+wspace='[ ]*'
+DUMP_LOCATION=`grep "^${wspace}DumpLocation${wspace}=" @sysconfdir@/abrt/abrt.conf \
+ | sed -e "s/^${wspace}DumpLocation${wspace}=${wspace}//" -e "s/${wspace}\$//"`
-if [ "$DUMP_LOCATION" = "" ]; then
+if [ x"$DUMP_LOCATION" = x"" ]; then
DUMP_LOCATION=$DEFAULT_LOCATION
+else
+ if [ x"${DUMP_LOCATION#* }" != x"$DUMP_LOCATION" ]; then
+ # DUMP_LOCATION has a space.
+ DUMP_LOCATION=$DEFAULT_LOCATION
+ fi
fi
PATTERN_FILE="/proc/sys/kernel/core_pattern"