#!/bin/bash TS="$(date -u +%s)" if [ ! -z "$1" ] then if [ ! -z "$2" ] then if [ ! -z "$3" ] then echo "$TS" "$1" "$2" "$3" >> $AK_LOGSFILE if [ "$AK_DEBUG" == "yes" ] then echo "$TS" "$1" "$2" "$3" >&2 fi exit 0 else echo "$TS" "$1" "[ERROR]" "No message" >> $AK_LOGSFILE if [ "$AK_DEBUG" == "yes" ] then echo "$TS" "$1" "[ERROR]" "No message" >&2 fi exit 1 fi else echo "$TS" "$1" "[ERROR]" "No type and message" >> $AK_LOGSFILE if [ "$AK_DEBUG" == "yes" ] then echo "$TS" "$1" "[ERROR]" "No type and message" >&2 fi exit 1 fi else echo "$TS" "<$(basename $0)>" "[ERROR]" "No arguments given" >> $AK_LOGSFILE if [ "$AK_DEBUG" == "yes" ] then echo "$TS" "<$(basename $0)>" "[ERROR]" "No arguments given" >&2 fi exit 1 fi