summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rwxr-xr-ximpressive-display/bin/impressive-display23
2 files changed, 25 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 56f2a41..b1c5e57 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+impressive-display (0.2.1) UNRELEASED; urgency=medium
+
+ * Make cleanup trap more genuine: Really clean-up all created temporary
+ files, make sure the impressive executable gets killed during clean-up.
+
+ -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Tue, 29 Mar 2016 20:14:17 +0200
+
impressive-display (0.2.0) unstable; urgency=medium
* Initial release.
diff --git a/impressive-display/bin/impressive-display b/impressive-display/bin/impressive-display
index 22a584a..e1f654a 100755
--- a/impressive-display/bin/impressive-display
+++ b/impressive-display/bin/impressive-display
@@ -159,13 +159,26 @@ if [ -n "$HTTP_PROXY_URL" ]; then
fi
function cleanup {
- if [ -e "$impressive_lock" ]; then
- rm "$impessive_lock"
- fi
- if [ -e "$session_lock" ]; then
- rm "$session_lock"
+ if [ -r "$impressive_lock" ]; then
+ impressive_pid=$(cat "$impressive_lock" | sed -e 's/[^0-9]*//g')
+ if [ -n "$impressive_pid" ]; then
+ kill -0 $impressive_pid 2>/dev/null && kill "$impressive_pid"
+ fi
fi
+
+ for rmfile in $impressive_lock \
+ $session_lock \
+ $pdffile_previous \
+ $pdffile_downloaded \
+ $pdffile_display \
+ ;
+ do
+ if [ -e "$rmfile" ]; then
+ rm "$rmfile"
+ fi
+ done
+
}
function pdf_is_portrait {