summaryrefslogtreecommitdiff
path: root/hel/recv-media.nix
blob: e0dc261fc164c63a3fd43e35aa79a81178737b52 (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

  mv "$1" "''${dir}/$(basename "$1")"
''