diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2020-11-01 02:09:45 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2020-11-01 02:09:45 +0300 |
commit | 57169578b681ca97de24073bea22e5bde0785573 (patch) | |
tree | cc3ebcfb04f71e1c76d13a12e640ce210a2d9b62 | |
parent | ffc7f79d46bd4f0c3a72254a12c00638abfa87b7 (diff) | |
parent | bc6e31d1c362a4be1c5eae8f90d000da28d2ff47 (diff) |
-rwxr-xr-x | peerflix-deadbeef | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/peerflix-deadbeef b/peerflix-deadbeef index 63901e7..26714b0 100755 --- a/peerflix-deadbeef +++ b/peerflix-deadbeef @@ -18,6 +18,12 @@ get_deadbeef() { fi } +tempdir() { + for TMPDIR in "$TMPDIR" "$TMP" /var/tmp /tmp; do + test -d "$TMPDIR" && echo "$TMPDIR" && break + done +} + download() { local source="$1" local target="$2" @@ -36,11 +42,11 @@ usage() { exit } -mktemp_m3u() { - mktemp $TMPDIR/$(uuidgen).m3u +tempname() { + echo $(tempdir)/$(uuidgen).m3u } -VERSION="0.2" +VERSION="0.3" NAME="peerflix-deadbeef" DEADBEEF="$(get_deadbeef)" @@ -53,7 +59,7 @@ installed curl || installed wget || error "curl or wget is required" if [[ "$1" == "--ready" ]]; then host="$2" port="$3" - file=$(mktemp_m3u) + file=$(tempname) url="http://$host:$port/.m3u" usleep 100000 |