From 7e0de0e5c01271d5aba98c65c7ed01d4adc11053 Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 15 Dec 2015 13:40:50 +0100 Subject: [PATCH] Fixed more typos :( --- dev/debug_osync.sh | 20 ++++++++++++++++---- dev/n_osync.sh | 14 +++++++++++++- dev/ofunctions.sh | 6 +++--- osync.sh | 20 ++++++++++++++++---- 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index da3b3a2..ce27df1 100755 --- a/dev/debug_osync.sh +++ b/dev/debug_osync.sh @@ -4,10 +4,10 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=1.1-pre -PROGRAM_BUILD=2015112805 +PROGRAM_BUILD=2015121501 IS_STABLE=no -FUNC_BUILD=2015121502 +FUNC_BUILD=2015121503 ## BEGIN Generic functions for osync & obackup written in 2013-2015 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -278,9 +278,9 @@ function SendAlert { fi if type mail > /dev/null 2>&1 ; then - if $(type -p mail) -V | grep "GNU" > /dev/null; then echo ok; fi + if $(type -p mail) -V | grep "GNU" > /dev/null; then attachment_command="-A $ALERT_LOG_FILE" - elif $(type -p mail) -V; then + elif $(type -p mail) -V > /dev/null; then attachment_command="-a $ALERT_LOG_FILE" else attachment_command="" @@ -923,11 +923,23 @@ function TrapStop { function TrapQuit { if [ $ERROR_ALERT -ne 0 ]; then UnlockReplicas + if [ "$_DEBUG" != "yes" ] + then + SendAlert + else + Log "Debug mode, no alert mail will be sent." + fi CleanUp Logger "$PROGRAM finished with errors." "ERROR" exitcode=1 elif [ $WARN_ALERT -ne 0 ]; then UnlockReplicas + if [ "$_DEBUG" != "yes" ] + then + SendAlert + else + Log "Debug mode, no alert mail will be sent." + fi CleanUp Logger "$PROGRAM finished with warnings." "WARN" else diff --git a/dev/n_osync.sh b/dev/n_osync.sh index c5cb74c..c98c7f4 100755 --- a/dev/n_osync.sh +++ b/dev/n_osync.sh @@ -4,7 +4,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=1.1-pre -PROGRAM_BUILD=2015112805 +PROGRAM_BUILD=2015121501 IS_STABLE=no source "./ofunctions.sh" @@ -30,11 +30,23 @@ function TrapStop { function TrapQuit { if [ $ERROR_ALERT -ne 0 ]; then UnlockReplicas + if [ "$_DEBUG" != "yes" ] + then + SendAlert + else + Log "Debug mode, no alert mail will be sent." + fi CleanUp Logger "$PROGRAM finished with errors." "ERROR" exitcode=1 elif [ $WARN_ALERT -ne 0 ]; then UnlockReplicas + if [ "$_DEBUG" != "yes" ] + then + SendAlert + else + Log "Debug mode, no alert mail will be sent." + fi CleanUp Logger "$PROGRAM finished with warnings." "WARN" else diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index dcfd591..e1184c2 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,4 +1,4 @@ -FUNC_BUILD=2015121502 +FUNC_BUILD=2015121503 ## BEGIN Generic functions for osync & obackup written in 2013-2015 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -269,9 +269,9 @@ function SendAlert { fi if type mail > /dev/null 2>&1 ; then - if $(type -p mail) -V | grep "GNU" > /dev/null; then echo ok; fi + if $(type -p mail) -V | grep "GNU" > /dev/null; then attachment_command="-A $ALERT_LOG_FILE" - elif $(type -p mail) -V; then + elif $(type -p mail) -V > /dev/null; then attachment_command="-a $ALERT_LOG_FILE" else attachment_command="" diff --git a/osync.sh b/osync.sh index 6a37edc..fa603f2 100755 --- a/osync.sh +++ b/osync.sh @@ -4,10 +4,10 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=1.1-pre -PROGRAM_BUILD=2015112805 +PROGRAM_BUILD=2015121501 IS_STABLE=no -FUNC_BUILD=2015121502 +FUNC_BUILD=2015121503 ## BEGIN Generic functions for osync & obackup written in 2013-2015 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -266,9 +266,9 @@ function SendAlert { fi if type mail > /dev/null 2>&1 ; then - if $(type -p mail) -V | grep "GNU" > /dev/null; then echo ok; fi + if $(type -p mail) -V | grep "GNU" > /dev/null; then attachment_command="-A $ALERT_LOG_FILE" - elif $(type -p mail) -V; then + elif $(type -p mail) -V > /dev/null; then attachment_command="-a $ALERT_LOG_FILE" else attachment_command="" @@ -822,11 +822,23 @@ function TrapStop { function TrapQuit { if [ $ERROR_ALERT -ne 0 ]; then UnlockReplicas + if [ "$_DEBUG" != "yes" ] + then + SendAlert + else + Log "Debug mode, no alert mail will be sent." + fi CleanUp Logger "$PROGRAM finished with errors." "ERROR" exitcode=1 elif [ $WARN_ALERT -ne 0 ]; then UnlockReplicas + if [ "$_DEBUG" != "yes" ] + then + SendAlert + else + Log "Debug mode, no alert mail will be sent." + fi CleanUp Logger "$PROGRAM finished with warnings." "WARN" else