Capitalize log messages
authorAlexander Barton <alex@barton.de>
Mon, 7 Dec 2015 09:22:07 +0000 (10:22 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 7 Dec 2015 09:22:07 +0000 (10:22 +0100)
scripts/trigger-rcmd

index 0ec4bec..ae709d5 100755 (executable)
@@ -33,13 +33,13 @@ do_rcmd() {
        . "$cnf"
 
        if [ $? -ne 0 ]; then
-               echo "$NAME: failed to read \"$cnf\"!"
+               echo "$NAME: Failed to read \"$cnf\"!"
                return 2
        fi
 
        NAME="$NAME($1)"
 
-       echo "$NAME: checking system \"$SYSTEM\" ..."
+       echo "$NAME: Checking system \"$SYSTEM\" ..."
        fping -c1 -q "$SYSTEM" 2>/dev/null
        if [ $? -ne 0 ]; then
                if [ -n "$NO_WAKE" ]; then
@@ -50,10 +50,10 @@ do_rcmd() {
                echo "$NAME: \"$SYSTEM\" seems to be down, wake it up ..."
                etherwake -b -i "$IFACE" `echo "$SYSTEM" | cut -d'.' -f1`
                if [ $? -ne 0 ]; then
-                       echo "$NAME: failed to wake \"$SYSTEM\"!" >&2
+                       echo "$NAME: Failed to wake \"$SYSTEM\"!" >&2
                        return 3
                fi
-               echo "$NAME: waiting for \"$SYSTEM\" to respond ..."
+               echo "$NAME: Waiting for \"$SYSTEM\" to respond ..."
                for i in `seq 1 $TIMEOUT`; do
                        fping -c1 -q "$SYSTEM" 2>/dev/null
                        [ $? -ne 0 ] || break
@@ -61,7 +61,7 @@ do_rcmd() {
                done
                fping -c1 -q "$SYSTEM" 2>/dev/null
                if [ $? -ne 0 ]; then
-                       echo "$NAME: failed to wake \"$SYSTEM\"!" >&2
+                       echo "$NAME: Failed to wake \"$SYSTEM\"!" >&2
                        return 4
                fi
                sleep "$WAKE_DELAY"
@@ -72,41 +72,41 @@ do_rcmd() {
        fi
 
        for i in `seq 1 $SSH_CHECKS`; do
-               echo "$NAME: checking SSH connection ($i/$SSH_CHECKS) ..."
+               echo "$NAME: Checking SSH connection ($i/$SSH_CHECKS) ..."
                ssh -q "$SYSTEM" true >/dev/null 2>&1 && break
                echo "$NAME: SSH on \"$SYSTEM\" not ready. Waiting ..."
                sleep 10s
        done
-       echo "$NAME: ok, SSH seems to be available on \"$SYSTEM\"."
+       echo "$NAME: Ok, SSH seems to be available on \"$SYSTEM\"."
 
        if [ "$rsys_was_running" -eq 0 ]; then
                echo "$NAME: \"$SYSTEM\" just started up. Delaying actions for $BOOT_DELAY ..."
                sleep "$BOOT_DELAY"
        fi
 
-       echo "$NAME: calling \"$CMD\" on \"$SYSTEM\" ..."
+       echo "$NAME: Calling \"$CMD\" on \"$SYSTEM\" ..."
        echo
 
        ssh -q "$SYSTEM" "$CMD" </dev/null ; r=$?
 
        echo
-       echo "$NAME: remote command ended with return code $r."
+       echo "$NAME: Remote command ended with return code $r."
        sleep 2
 
        if [ "$rsys_was_running" -eq 0 ]; then
                rsys_users=`ssh -q "$SYSTEM" w | tail -n +3 | wc -l`
                if [ "$rsys_users" = "0" ]; then
-                       echo "$NAME: power off \"$SYSTEM\" again ..."
+                       echo "$NAME: Power off \"$SYSTEM\" again ..."
                        ssh -q "$SYSTEM" "sync; shutdown -hP $SHUTDOWN_TIME" >/dev/null
                        if [ $? -ne 0 ]; then
-                               echo "$NAME: failed to power off \"$SYSTEM\"!" >&2
+                               echo "$NAME: Failed to power off \"$SYSTEM\"!" >&2
                                return 5
                        fi
                else
-                       echo "$NAME: not shutting down \"$SYSTEM\", \c"
+                       echo "$NAME: Not shutting down \"$SYSTEM\", \c"
                        [ $rsys_users -eq 1 ] \
-                               && echo "there is 1 user logged in!" \
-                               || echo "there are $rsys_users users logged in!"
+                               && echo "There is 1 user logged in!" \
+                               || echo "There are $rsys_users users logged in!"
                fi
        else
                echo "$NAME: \"$SYSTEM\" was already alive, not shutting down."
@@ -144,12 +144,12 @@ result=0
 while [ $# -gt 0 ]; do
        cnf="$RCMD_D/$1"
        if [ ! -r "$cnf" ]; then
-               echo "$NAME: can't read \"$cnf\"!"
+               echo "$NAME: Can't read \"$cnf\"!"
                r=1
        else
-               echo "$NAME: working on \"$1\" - `date "+%Y-%m-%d %H:%M:%S"`"
+               echo "$NAME: Working on \"$1\" - `date "+%Y-%m-%d %H:%M:%S"`"
                do_rcmd "$1" ; r=$?
-               echo "$NAME: done ($r) - `date "+%Y-%m-%d %H:%M:%S"`"
+               echo "$NAME: Done ($r) - `date "+%Y-%m-%d %H:%M:%S"`"
        fi
        [ $r -ne 0 ] && result=1
        shift