#!/bin/sh

if [ ! -d /zTools/zPrivateConfig ] && [ -d /static ]
then
	BASE=/static
fi

if [ -d /zTools/zPrivateConfig ] && [ ! -d /static ] 
then
	BASE=/zTools/zPrivateConfig
fi

if [ -d /zTools/zShared ]
then
	BASE=/zTools/zShared
fi

MYNAME=$(uname -n)
if [ -d /zz/zShared ]
then
	BASE=/zz/zShared
fi


# if [  -d /zz/zPrivate/secrets ]
# then
# 	BASE=/zz/zPrivate
# fi

# if [  -d /zz/zSyno/secrets ]
# then
# 	BASE=/zz/zSyno
# fi

# if [ -f ${BASE}/secrets/.telegramenv ]
# then
#   . ${BASE}/secrets/.telegramenv
# else
#   echo "Created ${BASE}/secrets/.telegramenv"
#   echo "Please update contents and rerun"
#   echo "DUFUS="" " > ${BASE}/secrets/.telegramenv
#   echo "TCHATID="" " >> ${BASE}/secrets/.telegramenv
#   exit 1
# fi

# SCRIPT=$1
# MSG=$2
# MYNAME=`uname -n`

# SUBJECT=" ${MYNAME} - ${SCRIPT}: "

# DROP='{"chat_id": "'"${TCHATID}"'", "text": " '"${SUBJECT}"' '"${MSG}"'"}'
# curl -X POST \
#      -H 'content-type: application/json' \
#      -d "${DROP}" \
#      https://api.telegram.org/bot${DUFUS}/sendmessage

# rm -f ${MSG}

${BASE}/shared/_nmsgH $1 $2
