diff options
author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-05 17:13:42 +0200 |
---|---|---|
committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-05 17:13:42 +0200 |
commit | 4846c68c4afe640c91440123b7bccb007be5dfbd (patch) | |
tree | 23cdc23adf30294a380f06ec8ca5ad421c870c6d | |
parent | 832afc254c521dcf8608236e38aa8efdf127c126 (diff) | |
download | nixos-4846c68c4afe640c91440123b7bccb007be5dfbd.tar nixos-4846c68c4afe640c91440123b7bccb007be5dfbd.tar.gz nixos-4846c68c4afe640c91440123b7bccb007be5dfbd.tar.bz2 nixos-4846c68c4afe640c91440123b7bccb007be5dfbd.tar.xz nixos-4846c68c4afe640c91440123b7bccb007be5dfbd.zip |
cleanup recv-media
-rw-r--r-- | hel/recv-media.nix | 7 |
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 @@ | |||
3 | writeScriptBin "recv-media" '' | 3 | writeScriptBin "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 | '' |