diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-05-16 00:34:51 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-05-16 00:34:51 +0200 |
commit | 8ce2e7787c725b02af7eff04b094a53f178d71ed (patch) | |
tree | 32366add13046fb248c890aa4a510efa02eac018 /hel/recv-media.nix | |
parent | e985c76e88a6d9818371da2c3cf1d678dfd049a4 (diff) | |
download | nixos-8ce2e7787c725b02af7eff04b094a53f178d71ed.tar nixos-8ce2e7787c725b02af7eff04b094a53f178d71ed.tar.gz nixos-8ce2e7787c725b02af7eff04b094a53f178d71ed.tar.bz2 nixos-8ce2e7787c725b02af7eff04b094a53f178d71ed.tar.xz nixos-8ce2e7787c725b02af7eff04b094a53f178d71ed.zip |
simplify recv-media
Diffstat (limited to 'hel/recv-media.nix')
-rw-r--r-- | hel/recv-media.nix | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/hel/recv-media.nix b/hel/recv-media.nix index d8192e0f..3bdf0c73 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix | |||
@@ -10,15 +10,17 @@ writeScriptBin "recv-media" '' | |||
10 | dir=/var/media | 10 | dir=/var/media |
11 | 11 | ||
12 | file="''${dir}/.$(basename "$1")" | 12 | file="''${dir}/.$(basename "$1")" |
13 | file2="''${dir}/.copy.$(basename "$1")" | 13 | #file2="''${dir}/.copy.$(basename "$1")" |
14 | nFile="''${dir}/$(basename "$1")" | 14 | nFile="''${dir}/$(basename "$1")" |
15 | #cat > "''${file}" | ||
15 | cat > "''${file}" | 16 | cat > "''${file}" |
16 | if ! ffmpeg -v warning -i "''${file}" -c copy "''${file2}" 2>&1 </dev/null; then | 17 | mv "''${file}" "''${nFile}" |
17 | echo "Download of ''${file} failed" | 18 | # if ! ffmpeg -v warning -i "''${file}" -c copy "''${file2}" 2>&1 </dev/null; then |
18 | rm -f "''${nFile}" "''${file}" "''${file2}" | 19 | # echo "Download of ''${file} failed" |
19 | exit 1 | 20 | # rm -f "''${nFile}" "''${file}" "''${file2}" |
20 | else | 21 | # exit 1 |
21 | rm -f "''${file}" | 22 | # else |
22 | mv "''${file2}" "''${nFile}" | 23 | # rm -f "''${file}" |
23 | fi | 24 | # mv "''${file2}" "''${nFile}" |
25 | # fi | ||
24 | '' | 26 | '' |