{ stdenv, coreutils, writeScriptBin }: writeScriptBin "recv-media" '' #!${stdenv.shell} pid=$? exec 1> >(${pkgs.util-linux}/bin/logger --id=$pid -t recv-media -p user.notice) exec 2> >(${pkgs.util-linux}/bin/logger --id=$pid -t recv-media -p user.error) [[ -z "$1" || -z "$2" ]] && exit 2 PATH=${coreutils}/bin dir=/var/media target="''${dir}"/$(basename "$1") cp -lvn "$1" "''${target}" touch -c -m -t "$2" "''${target}" ''