diff options
Diffstat (limited to 'scripts/hostname/nfs1/30-autofs')
-rw-r--r-- | scripts/hostname/nfs1/30-autofs | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/scripts/hostname/nfs1/30-autofs b/scripts/hostname/nfs1/30-autofs new file mode 100644 index 0000000..0393acc --- /dev/null +++ b/scripts/hostname/nfs1/30-autofs @@ -0,0 +1,81 @@ +#!/bin/sh + +nfs_mount_opts='-nfsv4,gssname=host,sec=krb5p' + +# /home: auto_home +ldap_add "automountKey=/home,automountMapName=auto_master,${automount_basedn}" <<EOF +objectClass: automount +automountKey: /home +automountInformation: auto_home ${nfs_mount_opts} +EOF +ldap_add "automountMapName=auto_home,${automount_basedn}" <<EOF +objectClass: automountMap +automountMapName: auto_home +EOF + +# auto_home: * +ldap_add "automountKey=*,automountMapName=auto_home,${automount_basedn}" <<EOF +objectClass: automount +automountKey: * +automountInformation: ${fqdn}:/user/&/priv +EOF + +# /nfs/user: auto_user +ldap_add "automountKey=/nfs/user,automountMapName=auto_master,${automount_basedn}" <<EOF +objectClass: automount +automountKey: /nfs/user +automountInformation: auto_user ${nfs_mount_opts} +EOF +ldap_add "automountMapName=auto_user,${automount_basedn}" <<EOF +objectClass: automountMap +automountMapName: auto_user +EOF + +# auto_user: $user/{pub,priv} +for userquota in ${nfs_homedirs:-}; do + user=$(echo "$userquota" | awk -F: '{print $1}') + ldap_add "automountKey=${user},automountMapName=auto_user,${automount_basedn}" <<EOF +objectClass: automount +automountKey: ${user} +automountInformation: /priv ${fqdn}:/user/&/priv /pub ${fqdn}:/user/&/pub +EOF +done + +# /nfs/group: auto_group +ldap_add "automountKey=/nfs/group,automountMapName=auto_master,${automount_basedn}" <<EOF +objectClass: automount +automountKey: /nfs/group +automountInformation: auto_group ${nfs_mount_opts} +EOF +ldap_add "automountMapName=auto_group,${automount_basedn}" <<EOF +objectClass: automountMap +automountMapName: auto_group +EOF + +# auto_group: $group/{pub,priv} +for groupquota in ${nfs_groupdirs:-}; do + group=$(echo "$groupquota" | awk -F: '{print $1}') + ldap_add "automountKey=${group},automountMapName=auto_group,${automount_basedn}" <<EOF +objectClass: automount +automountKey: ${group} +automountInformation: /priv ${fqdn}:/group/&/priv /pub ${fqdn}:/group/&/pub +EOF +done + +# /nfs/media: auto_media +ldap_add "automountMapName=auto_media,${automount_basedn}" <<EOF +objectClass: automountMap +automountMapName: auto_media +EOF +ldap_add "automountKey=/nfs/media,automountMapName=auto_master,${automount_basedn}" <<EOF +objectClass: automount +automountKey: /nfs/media +automountInformation: auto_media ${nfs_mount_opts} +EOF + +# auto_media: music +ldap_add "automountKey=music,automountMapName=auto_media,${automount_basedn}" <<EOF +objectClass: automount +automountKey: music +automountInformation: ${fqdn}:/media/music +EOF |