{ stdenv, coreutils, ffmpeg-full, writeScriptBin }: writeScriptBin "recv-media" '' #!${stdenv.shell} PATH=${ffmpeg-full}/bin:${coreutils}/bin dir=/var/media file="''${dir}/.$(basename "$1")" file2="''${dir}/.copy.$(basename "$1")" nFile="''${dir}/$(basename "$1")" cat > "''${file}" if ! ffmpeg -v warning -i "''${file}" -c copy "''${file2}" 2>&1