diff options
Diffstat (limited to 'hel/recv-media.nix')
-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 5d2d2ea2..d30da5eb 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix | |||
@@ -27,6 +27,7 @@ writeScriptBin "recv-media" '' | |||
27 | [[ -z "$1" || -z "$2" ]] && exit 2 | 27 | [[ -z "$1" || -z "$2" ]] && exit 2 |
28 | 28 | ||
29 | dir=/var/media | 29 | dir=/var/media |
30 | group=$(stat -c '%G' $dir) | ||
30 | tmpFile="''${dir}"/.tmp/$(basename "$1") | 31 | tmpFile="''${dir}"/.tmp/$(basename "$1") |
31 | target="''${dir}"/$(basename "$1") | 32 | target="''${dir}"/$(basename "$1") |
32 | 33 | ||
@@ -37,9 +38,9 @@ writeScriptBin "recv-media" '' | |||
37 | $(echo ''${2}) | 38 | $(echo ''${2}) |
38 | EOF | 39 | EOF |
39 | 40 | ||
40 | if [[ $(id -gn) != "media" ]]; then | 41 | if [[ $(id -gn) != $group ]]; then |
41 | printf "Primary group is %s, trying to switch to media..." $(id -gn) | 42 | printf "Primary group is %s, trying to switch to %s..." $(id -gn) $group |
42 | exec -- sg media "$0 $*" | 43 | exec -- sg $group "$0 $*" |
43 | fi | 44 | fi |
44 | 45 | ||
45 | ( | 46 | ( |