#!/bin/bash
# TLMSG infok kiirasa

#::::::: Fix beallitasok ::::::
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
TLMSGLOG="/var/log/tlmsg/vfelsz.log"

#:::::::: functions :::::::::::

#--- ---
print_ver()
{
   unset LOGFILE
   if [ -s $TLMSGLOG ]; then
        LOGFILE=$TLMSGLOG
   elif [ -s $TLMSGLOG.0 ]; then
        LOGFILE=$TLMSGLOG.0
   elif [ -s $TLMSGLOG.1 ]; then
        LOGFILE=$TLMSGLOG.1
   fi
   if [ "$LOGFILE" != "" ]; then
       grep '\*\*\* TextLib.*V2' $LOGFILE | tail -n 1
   else
       echo "TLMSG log fajl nincs."
   fi
}

print_stat()
{
   echo "TextLib     MSG: telepitve"
}

#:::::::: Start :::::::::::::::

# $1 az lehet [dbname] is, akkor azt atugorni!
if [ "${1:0:1}" == "[" ]; then shift; fi

case "$1" in
    run|stop|start|restart|force-reload|reload)  
     ;;

    info)
        ;;

    list)
        ;;

    stat)
        print_stat
        ;;

    ver)
        print_ver
        ;;

    *)
        ;;
esac
exit 0
