How about this version? Can I push it?
#! /bin/sh
LPATHDIR="$HOME/.cache/abrt"
SINCEFILE="$LPATHDIR/lastnotification"
TMPPATH=`mktemp --tmpdir="$LPATHDIR" lastnotification.XXXXXXXX`
SINCE=0
if [ -f $SINCEFILE ]; then
---SINCE=`cat $SINCEFILE`
fi
# always update the lastnotification
date +%s > "$TMPPATH"
mv "$TMPPATH" "$SINCEFILE"
abrt-cli status --since="$SINCE"
On Monday 29 of April 2013 18:04:05 Jiri Moskovcak wrote:
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"