# 		Sample Rules for the nis_update Script

# Copy this file into a subdirectory with your NIS domain's name as
# .nisupdate.conf and edit it there to reflect the maps you have.

# For every possible transformation complex ( e.g. passwd+shadow ->
# *.byname+.byuid) there is a rule that is identified by a free-form string
# that is printed upon its execution. The contents of $rule{"$idstr"} determine
# the actual action to be taken.

# Rule syntax: "<func> <src>[,<src2>,...]  <dest>[,<dest2>,...] [func-options]"
# options must be last because they're optional :-)
# they are a comma separated list for each target:
# 0-9: key field
# 'n': exclude key field from value string
# ':': field separator (group, no shadow). passwd is special anyway.
#
# default is "0" for single DBs, "0,1" for dual DBs (*.byname,*.bynumber)

# I assume you want at least passwd and group.
# Un-comment the rest or add your own.

# $rule{"aliases"} =
#     "mkdb aliases mail.aliases n0:";

# $rule{"amd.home"} =
#     "mkdb amd.home amd.home n0";

# $rule{"amd.master"} =
#     "mkdb amd.master amd.master n0";

# $rule{"ethers"} =
#     "mkdb2 ethers ethers.byname,ethers.byaddr ";

$rule{"group"} =
    "mkdb2 group group.bygid,group.byname 2:,0:";

# $rule{"group.shadow"} =
#    "pwunconv group,gshadow group.bygid,group.byname";

# $rule{"hosts"} =
#     "mkdb2 hosts hosts.byname,hosts.byaddr 1,0";

# $rule{"netgroup"} =
#     "revnetgroup netgroup netgroup,netgroup.byuser,netgroup.byhost";

# $rule{"netid"} =
#     "mkdb netid netid.byname ";

# $rule{"networks"} =
#     "mkdb2 networks networks.byname,networks.byaddr 0,1";

$rule{"passwd"} =
    "pwunconv passwd,shadow passwd.byname,passwd.byuid,shadow.byname";

# $rule{"protocols"} =
#     "mkdb2 protocols protocols.byname,protocols.bynumber";

# $rule{"rpc"} =
#     "mkdb2 rpc rpc.byname,rpc.bynumber 1,0";

# $rule{"services"} =
#     "mkdb2 services services.byservicename,services.byservicenumber";

# $rule{""} = "mkdb  0";

