is_config_byhand

Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 04 April 2008
Index Return to Main Contents

 

NAME

is_config_byhand - check if file is listed in a .config_byhand* file

 

SYNOPSIS

edrc/lib/is_config_byhand [ -h ]

is_config_byhand -f file

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

Evaluate if a given file is listed in a config_byhand file. If so return 'True' else return 'False'. This command is intended to be be used in pre_exec and post_exec scripts called by sysconfig to prevent miss-configuration when re-applying a configuration to a previously configured system.

If sysconfig is called with the force option ( -f ), is_sysconfig_byhand returns False for all files queried.

 

OPTIONS

-h
usage message.

-f file
.

 

ENVIRONMENT

$SYSCONFIG_FORCE
if the environment variable $SYSCONFIG_FORCE is set to True is_config_byhand returns False for every file. This environment variable is set to True when sysconfig is invoked with the force ( -f ) option.

 

EXIT STATUS

0
file is listed in a config_byhand file. is_config_byhand returns True to stdout in this case.

1
file is not listed in any config_byhand file. is_config_byhand returns False to stdout in this case.

2
operating system is not supported, yet. See osid(3) if you get this error.

4
usage printed.

11
temporary directory could not be claimed or created in /tmp. Check the system temporary directory /tmp if you get this error, it is an indicator of system intrusion.

 

FILES

<root_dir>/.EDRC.config_byhand <root_dir>/.EDRC.config_byhand.<name>
a list of files to be protected from overwriting after the initial run of sysconfig.

<root_dir>/.config_byhand
a list of files to be protected from overwriting after the initial run of rmtconfig a system configuration tool provided by the SFI-Director. You should not enter new entries into this file, it is only considered to protect systems configured with rmtconfig from miss-configuration.

 

EXAMPLES

1) usage in a post_exec script

Create a system dependent /etc/issue file.

Hostname=`hostname`
Configuration='TEST CONFIGURATION - ACME, Datacenter Balsberg'


file=$SYSCONFIG_ROOTDIR/etc/issue
if [ "`is_config_byhand -f $file`" = False ]; then

    cat << EOM | apply2file -o -u bin -g bin -p 444 -f $file

`banner $Hostname`

 $Configuration

 #####################################################################
 #   This is an ACME protected system.                               #
 #   This system is for the use of authorized users only.            #
 #   Individuals using this computer system without authority, or in #
 #   excess of their authority, are subject to having all of their   #
 #   activities on this system monitored and recorded by system      #
 #   personnel.                                                      #
 #                                                                   #
 #   In the course of monitoring individuals improperly using this   #
 #   system, or in the course of system maintenance, the activities  #
 #   of authorized users may also be monitored.                      #
 #                                                                   #
 #   Anyone using this system expressly consents to such monitoring  #
 #   and is advised that if such monitoring reveals possible         #
 #   evidence of criminal activity, system personnel may provide the #
 #   evidence of such monitoring to law enforcement officials.       #
 #####################################################################

 EOM
 fi

 

SEE ALSO

apply2file(1), edrcintro(1), sysconfig(1)

 

NOTES

-

 

BUGS

-

 

AUTHOR

is_config_byhand was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2008 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:53:15 GMT, August 28, 2024