Commit 334b777f authored by Markus Frosch's avatar Markus Frosch

Test and fix log-notification.sh

parent b5698e92
Pipeline #179 passed with stage
in 32 seconds
......@@ -13,15 +13,23 @@ else
fi
wrap_nl() {
echo $(echo "$1" | sed 's/\n/\n /')
text="$1"
blank="$2"
if [ -z "$blank" ]; then
blank=" "
fi
echo "$(echo "$text" | sed "2~1s/^/$blank/g")"
}
output=$(wrap_nl "$OUTPUT")
if [ -n "$NOTIFICATIONAUTHORNAME" ]; then
output="$output\n Author: $NOTIFICATIONAUTHORNAME\n "$(wrap_nl "$NOTIFICATIONCOMMENT")
output+=`echo -e "\n Author: "`
output+="$NOTIFICATIONAUTHORNAME"
output+=`echo -e "\n Comment: "`
output+=$(wrap_nl "$NOTIFICATIONCOMMENT")
fi
printf "[%s] [%s] [%s] [%s] [%s] %s" \
printf "[%s] [%s] [%s] [%s] [%s] %s\n" \
"$DATE" "$USERNAME" "$OBJECT_NAME" "$NOTIFICATIONTYPE" "$STATE" "$output" \
>> "$LOGFILE"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment