summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hel/recv-media.nix18
1 files changed, 4 insertions, 14 deletions
diff --git a/hel/recv-media.nix b/hel/recv-media.nix
index 4ce05d44..e0dc261f 100644
--- a/hel/recv-media.nix
+++ b/hel/recv-media.nix
@@ -1,23 +1,13 @@
1{ stdenv, coreutils, ffmpeg-full, writeScriptBin }: 1{ stdenv, coreutils, writeScriptBin }:
2 2
3writeScriptBin "recv-media" '' 3writeScriptBin "recv-media" ''
4 #!${stdenv.shell} 4 #!${stdenv.shell}
5 5
6 [[ -z "$1" ]] && exit 2 6 [[ -z "$1" ]] && exit 2
7 7
8 PATH=${ffmpeg-full}/bin:${coreutils}/bin 8 PATH=${coreutils}/bin
9 9
10 dir=/var/media 10 dir=/var/media
11 11
12 file="''${dir}/.$(basename "$1")" 12 mv "$1" "''${dir}/$(basename "$1")"
13 #file2="''${dir}/.copy.$(basename "$1")"
14 nFile="''${dir}/$(basename "$1")"
15 #cat > "''${file}"
16 if ffmpeg -v warning -i "''$1" -c copy "''${file}" 2>&1 </dev/null; then
17 mv "''${file}" "''${nFile}"
18 else
19 echo "Download of ''${file} failed"
20 rm -f "''${nFile}" "''${file}"
21 exit 1
22 fi
23'' 13''