#!@BASH_SHELL@ # # Copyright (C) 1997-2003 Sistina Software, Inc. All rights reserved. # Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # declare RA_COMMON_pid_dir=/var/run/cluster declare RA_COMMON_conf_dir=/etc/cluster declare -i FAIL=255 declare -a ip_keys generate_configTemplate() { cat > "$1" << EOT # # "$1" was created from the "$2" # # This template configuration was automatically generated, and will be # automatically regenerated if removed. Once this file has been altered, # automatic re-generation will stop. Remember to copy this file to all # other cluster members after making changes, or your service will not # operate correctly. # EOT } generate_configTemplateXML() { cat > "$1" << EOT EOT } sha1_addToFile() { declare sha1line="# rgmanager-sha1 $(sha1sum "$1")" echo $sha1line >> "$1" } sha1_addToFileXML() { declare sha1line="" echo $sha1line >> "$1" } sha1_verify() { declare sha1_new sha1_old declare oldFile=$1 ocf_log debug "Checking: SHA1 checksum of config file $oldFile" sha1_new=`cat "$oldFile" | grep -v "# rgmanager-sha1" | sha1sum | sed 's/^\([a-z0-9]\+\) .*$/\1/'` sha1_old=`tail -n 1 "$oldFile" | sed 's/^\(