diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-05-16 00:43:25 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-05-16 00:43:25 +0200 |
| commit | 6ffc1cc5b18e0cd93cc930c21b5723393a24f9ce (patch) | |
| tree | 530c1d9acdd3f8da87351bca8a4f092c6ab2be74 /hel | |
| parent | 40eb2b577993e2dc24285790da0c625704c4568d (diff) | |
| download | nixos-6ffc1cc5b18e0cd93cc930c21b5723393a24f9ce.tar nixos-6ffc1cc5b18e0cd93cc930c21b5723393a24f9ce.tar.gz nixos-6ffc1cc5b18e0cd93cc930c21b5723393a24f9ce.tar.bz2 nixos-6ffc1cc5b18e0cd93cc930c21b5723393a24f9ce.tar.xz nixos-6ffc1cc5b18e0cd93cc930c21b5723393a24f9ce.zip | |
no integrity checking in recv-media
Diffstat (limited to 'hel')
| -rw-r--r-- | hel/recv-media.nix | 18 |
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 | ||
| 3 | writeScriptBin "recv-media" '' | 3 | writeScriptBin "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 | '' |
