summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hel/recv-media.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/hel/recv-media.nix b/hel/recv-media.nix
index 5994ebea..2ae78e90 100644
--- a/hel/recv-media.nix
+++ b/hel/recv-media.nix
@@ -3,12 +3,13 @@
3writeScriptBin "recv-media" '' 3writeScriptBin "recv-media" ''
4 #!${stdenv.shell} 4 #!${stdenv.shell}
5 5
6 [[ -z "$1" ]] && exit 2 6 [[ -z "$1" || -z "$2" ]] && exit 2
7 7
8 PATH=${coreutils}/bin 8 PATH=${coreutils}/bin
9 9
10 dir=/var/media 10 dir=/var/media
11 target="''${dir}"/$(basename "$1")
11 12
12 cp -ln "$1" "''${dir}/$(basename "$1")" 13 cp -ln "$1" "''${target}"
13 [[ -n "$2" ]] && touch -c -d "$(print "$2" | tr '_' ' ')" "''${dir}/$(basename "$1")" 14 touch -c -d "$(print "$2" | tr '_' ' ')" "''${target}"
14'' 15''