summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-09-18 09:54:43 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-09-18 09:54:43 +0200
commit022f22e140977ad83d017a30744201f34089162a (patch)
tree5cb314ceb49160b1ec3f0478162f5b1d134d9eac
parent1378e31bad614bd153f385859773a5d40469d069 (diff)
downloadbin-022f22e140977ad83d017a30744201f34089162a.tar.gz
bin-022f22e140977ad83d017a30744201f34089162a.tar.xz
mutt-open: Force /tmp; fix filename; force background
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xmutt-open7
1 files changed, 4 insertions, 3 deletions
diff --git a/mutt-open b/mutt-open
index 00dbca1..2e74833 100755
--- a/mutt-open
+++ b/mutt-open
@@ -7,7 +7,8 @@ set -euo pipefail
command=$1
file=$2
-tmpdir=$(mktemp -d 'mutt-open.XXXXXXXXX')
-filename="${1##*/}"
+tmpdir=$(mktemp -p /tmp -d 'mutt-open.XXXXXXXXX')
+filename="${file##*/}"
cp "$file" "$tmpdir/$filename"
-systemd-cat "$command" "$tmpdir/$filename"
+systemd-cat "$command" "$tmpdir/$filename" &
+disown