aboutsummaryrefslogtreecommitdiff
path: root/scripts/hostname/nfs1/20-shares
blob: 0dd6ddb1202fc2bf8837c0b76b7c4dfe91487381 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

media_access_group='media-access'
media_admin_group='media-admin'
media_shares='music shows movies audiobooks roms books scores isos'

# media shares
for share in $media_shares; do
  create_dataset -p "${nfs_dataset}/media/${share}"
  zfs set \
    compression=off \
    com.sun:auto-snapshot:daily=true \
    com.sun:auto-snapshot:weekly=true \
    "${nfs_dataset}/media/${share}"
  chgrp "$media_admin_group" "${nfs_root}/media/${share}"
  chmod 2770 "${nfs_root}/media/${share}"
  set_facl "${nfs_root}/media/${share}" \
     "group:${media_admin_group}:rwpDdaARWcs:fd:allow" \
     "group:${media_admin_group}:x:d:allow" \
     "group:${media_access_group}:raRcs:fd:allow" \
     "group:${media_access_group}:x:d:allow"
done