#! /bin/sh

if [ "$1" = "--version" ]
then
cat << EOF
init_policy 1.8.0

Copyright (C) 2005-2010 NTT DATA CORPORATION.

This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
EOF
elif [ "$1" = "--help" ]
then
cat << EOF
Usage: init_policy [--file-only-profile|--full-profile] [--use_profile=$profile] [--use_group=$group] [--max_audit_log=$logs] [--max_learning_entry=$entry] [--enforcing_penalty=$penalty] [--grant_log=$bool] [--reject_log=$bool]

This program generates templates for all policy files.
You need to review the output because automatically generated exception policy may contain redundant or dangerous entries.

  --file-only-profile          Create profile with only file access control feature enabled.
  --full-profile               Create profile with all features enabled.
  --use_profile=$profile       Set default profile number to $profile (where $profile is an integer between 0 and 255).
  --use_group=$group           Set default group number to $group (where $group is an integer between 0 and 255).
  --max_audit_log=$logs        Set default maximal audit logs to $logs (where $logs is an integer).
  --max_learning_entry=$entry  Set default maximal entries to appended by learning mode to $entry (where $entry is an integer).
  --enforcing_penalty=$penalty Set default penalty by enforcing mode to $entry (where $entry is an integer).
  --grant_log=$bool            Set default grant log mode to $bool (where $bool is either yes or no).
  --reject_log=$bool           Set default reject log mode to $bool (where $bool is either yes or no).

Examples:

None.

EOF
else
cat << EOF | help2man -i - -N -s 8 -n "Initialize TOMOYO Linux's policy" $0 | gzip -9 > man8/init_policy.8.gz
[SEE ALSO]

 ccs-init (8)

[NOTES]

 You don't need to run this program after you have successfully initialized policy.

[AUTHORS]

 penguin-kernel _at_ I-love.SAKURA.ne.jp

 Bug fix for Gentoo 64bit environment by Naohiro Aota <naota _at_ namazu.org>.

EOF
fi
exit 0
