summaryrefslogtreecommitdiff
path: root/runescape-launcher-launcher
diff options
context:
space:
mode:
Diffstat (limited to 'runescape-launcher-launcher')
-rwxr-xr-xrunescape-launcher-launcher12
1 files changed, 10 insertions, 2 deletions
diff --git a/runescape-launcher-launcher b/runescape-launcher-launcher
index 50aff81..bdbe604 100755
--- a/runescape-launcher-launcher
+++ b/runescape-launcher-launcher
@@ -4,7 +4,15 @@ set -e
xdg_data_home=${XDG_DATA_HOME:-$HOME/.local/share}
rll=$xdg_data_home/runescape-launcher-launcher
tmpdir=$(mktemp -dt runescape-launcher-launcher.XXXXXXXXXX)
-trap 'trap "" INT TERM QUIT EXIT; echo "cleaning up temporary directory..." >&2; rm -rf "$tmpdir"' INT TERM QUIT EXIT
+cleanup() {
+ echo "cleaning up temporary directory..." >&2
+ rm -rf "$tmpdir"
+}
+trapped="1 2 3 13 15"
+for sig in $trapped; do
+ trap "trap $trapped; cleanup; kill -$sig $$" $sig
+done
+trap 'cleanup' EXIT
if [ -f "$rll/Packages" ]; then
echo "checking for runescape-launcher updates..."
else
@@ -34,7 +42,7 @@ if ! cmp "$rll/Packages" "$tmpdir/Packages" 2>/dev/null; then
else
echo "no updates available for runescape-launcher." >&2
fi
-trap '' INT TERM QUIT EXIT
+trap $trapped
rm -rf "$tmpdir"
echo "starting runescape-launcher..." >&2
set -x