[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a
David GUENAULT
dguenault at monitoring-fr.org
Tue Feb 28 22:22:24 UTC 2012
The following commit has been merged in the debian/master branch:
commit fdc25d31f1139a4d59881f0cfac5e72a2e711365
Author: David GUENAULT <dguenault at monitoring-fr.org>
Date: Sat Feb 25 07:06:30 2012 +0100
removed trap usage (does not match our needs
diff --git a/contrib/alternative-installation/shinken-install/shinken.sh b/install
similarity index 98%
copy from contrib/alternative-installation/shinken-install/shinken.sh
copy to install
index 557fd55..8d584d5 100755
--- a/contrib/alternative-installation/shinken-install/shinken.sh
+++ b/install
@@ -20,10 +20,6 @@
#You should have received a copy of the GNU Affero General Public License
#along with Shinken. If not, see <http://www.gnu.org/licenses/>.
-if [ -f $TMP/shinken.install.log ]
-then
- rm -f $TMP/shinken.install.log
-fi
#####################
### ENVIRONNEMENT ###
@@ -33,20 +29,10 @@ export myscripts=$(readlink -f $(dirname $0))
src=$(readlink -f "$myscripts/../../..")
. $myscripts/shinken.conf
-function trap_handler()
-{
- MYSELF="$0" # equals to my script name
- LASTLINE="$1" # argument 1: last line of error occurence
- LASTERR="$2" # argument 2: error code of last command
- FUNCTION="$3"
- if [ -z "$3" ]
- then
- cecho "[FATAL] Unexpected error on line ${LASTLINE}" red
- else
- cecho "[FATAL] Unexpected error on line ${LASTLINE} in function ${FUNCTION} ($LASTERR)" red
- fi
- exit 2
-}
+if [ -f $TMP/shinken.install.log ]
+then
+ rm -f $TMP/shinken.install.log
+fi
function remove(){
cadre "Removing shinken" green
@@ -198,7 +184,6 @@ function skill(){
function setdirectives(){
- trap 'trap_handler ${LINENO} $? setdirectives' ERR
directives=$1
fic=$2
mpath=$3
@@ -220,7 +205,6 @@ function setdirectives(){
##############################
function create_user(){
- trap 'trap_handler ${LINENO} $? create_user' ERR
cadre "Creating user" green
if [ ! -z "$(cat /etc/passwd | grep $SKUSER)" ]
then
@@ -232,7 +216,6 @@ function create_user(){
}
function check_exist(){
- trap 'trap_handler ${LINENO} $? check_exist' ERR
cadre "Checking for existing installation" green
if [ -d "$TARGET" ]
then
@@ -514,7 +497,6 @@ function check_distro(){
}
function get_from_git(){
- trap 'trap_handler ${LINENO} $? get_from_git' ERR
cadre "Getting shinken" green
cd $TMP
if [ -e "shinken" ]
@@ -531,7 +513,6 @@ function get_from_git(){
}
function relocate(){
- trap 'trap_handler ${LINENO} $? relocate' ERR
cadre "Relocate source tree to $TARGET" green
# relocate source tree
cd $TARGET
@@ -595,7 +576,6 @@ function relocate(){
}
function fix(){
- trap 'trap_handler ${LINENO} $? fix' ERR
cadre "Applying various fixes" green
chmod +x /etc/init.d/shinken
chmod +x /etc/default/shinken
@@ -607,7 +587,6 @@ function fix(){
}
function enable(){
- trap 'trap_handler ${LINENO} $? enable' ERR
cadre "Enabling startup scripts" green
cp $TARGET/bin/init.d/shinken* /etc/init.d/
case $DISTRO in
@@ -624,7 +603,6 @@ function enable(){
}
function sinstall(){
- #trap 'trap_handler ${LINENO} $? install' ERR
#cecho "Installing shinken" green
check_distro
check_exist
@@ -654,7 +632,6 @@ function sinstall(){
########################
function backup(){
- trap 'trap_handler ${LINENO} $? backup' ERR
cadre "Backup shinken configuration, plugins and data" green
skill
if [ ! -e $BACKUPDIR ]
@@ -671,7 +648,6 @@ function backup(){
}
function backuplist(){
- trap 'trap_handler ${LINENO} $? backuplist' ERR
cadre "List of available backups in $BACKUPDIR" green
for d in $(ls -1 $BACKUPDIR | grep "bck-shinken" | awk -F. '{print $2}')
do
@@ -681,7 +657,6 @@ function backuplist(){
}
function restore(){
- trap 'trap_handler ${LINENO} $? restore' ERR
cadre "Restore shinken configuration, plugins and data" green
skill
if [ ! -e $BACKUPDIR ]
@@ -713,7 +688,6 @@ function restore(){
########################
function supdate(){
- trap 'trap_handler ${LINENO} $? update' ERR
curpath=$(pwd)
if [ "$src" == "$TARGET" ]
--
UNNAMED PROJECT
More information about the Pkg-nagios-changes
mailing list