#! /bin/sh

if [ "$1" = "--version" ]
then
cat << EOF
tomoyo-checkpolicy 2.3.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: tomoyo-checkpolicy {e|d} < policy_to_check

This program validates TOMOYO Linux's policy.

 e     Interpret input as exception policy. ( /etc/tomoyo/exception_policy.conf )

 d     Interpret input as domain policy. ( /etc/tomoyo/domain_policy.conf )

Examples:

# tomoyo-checkpolicy e < /etc/tomoyo/exception_policy.conf
 Check for errors in exception policy.

# tomoyo-checkpolicy d < /etc/tomoyo/domain_policy.conf
 Check for errors in domain policy.

EOF
else
cat << EOF | help2man -i - -N -s 8 -n "TOMOYO Linux's policy validator" $0 | gzip -9 > man8/tomoyo-checkpolicy.8.gz
[AUTHORS]

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

EOF
fi
exit 0
