Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
src/cli/abrt-console-notification.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/cli/abrt-console-notification.sh b/src/cli/abrt-console-notification.sh
index d1defc8..6be1620 100755
--- a/src/cli/abrt-console-notification.sh
+++ b/src/cli/abrt-console-notification.sh
@@ -1,13 +1,16 @@
#! /bin/sh
-LPATH="$HOME/.cache/abrt/lastnotificaion"
+LPATHDIR="$HOME/.cache/abrt/"
+SINCEFILE="lastnotificaion"
+TMPPATH=`mktemp --tmpdir="$LPATHDIR"`
SINCE=0
if [ -f $LPATH ]; then
- SINCE=`cat $LPATH`
+ SINCE=`cat $LPATHDIR$SINCEFILE`
fi
# always update the lastnotification
-date +%s > "$LPATH"
+date +%s > "$TMPPATH"
+mv "$TMPPATH" "$LPATHDIR$SINCEFILE"
abrt-cli status --since="$SINCE"
--
1.8.1.4