Setup - Global Customize functions
use vars qw(@ISA); use Setup; @ISA = qw(Setup);
This module implements standard customize functions, both functions that should be used in modules and internal customize functions.
First description of the arguments that are being used in the functions.
FILE, SRCFILE, DSTFILE are filenames. DATA is the data that is going to be inserted. PERM is if the file should have any specific permissions and its entered in an octal number. COMMENTSIGN is the commentsign to use when modifying a file. '#' is default. NOBACKUP set it to 1 if you don't want the function to take a backup for later uninstall
add_to_file('/etc/testfil','Testar',0755,'',1); $DATA = "set noexec_user_stack = 1\n"; $DATA .= "set noexec_user_stack_log = 1\n"; add_to_file('/etc/system',$DATA,'*');
The second exampel will give you this in your /etc/system
* BEGIN: setup_etc_system Checksum: 5139 set noexec_user_stack = 1 set noexec_user_stack_log = 1 * END: setup_etc_system Checksum: 5139
It returns 0 if an error accured, 1 if the file was changed and 2 if it didn't need to do anything.
Returns 0 if an error accured, 1 if the file was changed and 2 if it didn't need to do anything
create_file($ypservers, $YPDATA, 0600);
verify_create_file($ypservers, $YPDATA, 0600);
get_datafile(SRCFILE)If DSTFILE is a directory
basename(SRCFILE)is added to the path. Then it checks if DSTFILE exists, size and its mtime. It compares it with the SRCFILE and if its differs it will copy SRCFILE to DSTFILE. The DSTFILE will be chown:ed if USER and GROUP is set. If only a user is specified that users gid will be used. It is not allowed to specify a group and not a user.
get_datafile(SRCFILE)Then it copies it to the customize tempdirectory and searches for @Custom::VAR_NAME@ and replaces it with the value of $Custom::VAR_NAME. If the size or content diffs with the DSTFILE it will replace it.
/custom/data/Local/<script name>/<OS>/filename /custom/data/Local/<script name>/filename /custom/data/<Category>/<script name>/<OS>/filename /custom/data/<Category>/<script name>/filename
Returns true if its workhour. It can be usefull to know in scripts if we should start a process that can take several hours to complete or not. (Like patching Solaris machines).
Copyright (c) 2000-2001 Ericsson Erisoft AB. All rights reserved. Copyright (c) 2001-2003 Joacim Häggmark. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Joacim Häggmark <email@example.com>