summaryrefslogtreecommitdiff
path: root/hel/recv-media.nix
blob: b61840ec742ab2f921d64e6eea5a25fe37a05bfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{ stdenv, coreutils, writeScriptBin }:

writeScriptBin "recv-media" ''
  #!${stdenv.shell}

  [[ -z "$1" ]] && exit 2

  PATH=${coreutils}/bin

  dir=/var/media

  cp -l "$1" "''${dir}/$(basename "$1")"
''