.
This commit is contained in:
38
shared/_nmsg
Executable file
38
shared/_nmsg
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# if [ -d /zTools/zPrivateConfig/shared ] && [ ! -d /static ]
|
||||||
|
# then
|
||||||
|
# BASE=/zTools/zPrivateConfig/shared
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# if [ ! -d /zTools/zPrivateConfig/shared ] && [ -d /static ]
|
||||||
|
# then
|
||||||
|
# BASE=/static
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# if [ -f ${BASE}/shared/.telegramenv ]
|
||||||
|
# then
|
||||||
|
# . ${BASE}/shared/.telegramenv
|
||||||
|
# else
|
||||||
|
# echo "Created ${BASE}/shared/.telegramenv"
|
||||||
|
# echo "Please update contents and rerun"
|
||||||
|
# echo "DUFUS="" " > ${BASE}/shared/.telegramenv
|
||||||
|
# echo "TCHATID="" " >> ${BASE}/shared/.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}
|
||||||
|
|
||||||
|
curl -d "${SUBJECT} ${MSG}" ntfy.sh/hInfo
|
||||||
36
shared/_tmsg
Executable file
36
shared/_tmsg
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -d /zTools/zPrivateConfig/shared ] && [ ! -d /static ]
|
||||||
|
then
|
||||||
|
BASE=/zTools/zPrivateConfig/shared
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d /zTools/zPrivateConfig/shared ] && [ -d /static ]
|
||||||
|
then
|
||||||
|
BASE=/static
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f ${BASE}/shared/.telegramenv ]
|
||||||
|
then
|
||||||
|
. ${BASE}/shared/.telegramenv
|
||||||
|
else
|
||||||
|
echo "Created ${BASE}/shared/.telegramenv"
|
||||||
|
echo "Please update contents and rerun"
|
||||||
|
echo "DUFUS="" " > ${BASE}/shared/.telegramenv
|
||||||
|
echo "TCHATID="" " >> ${BASE}/shared/.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}
|
||||||
48
shared/tmsg
48
shared/tmsg
@ -1,36 +1,38 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ -d /zTools/zPrivateConfig/shared ] && [ ! -d /static ]
|
if [ -d /zTools/zPrivateConfig ] && [ ! -d /static ]
|
||||||
then
|
then
|
||||||
BASE=/zTools/zPrivateConfig/shared
|
BASE=/zTools/zPrivateConfig
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d /zTools/zPrivateConfig/shared ] && [ -d /static ]
|
if [ ! -d /zTools/zPrivateConfig ] && [ -d /static ]
|
||||||
then
|
then
|
||||||
BASE=/static
|
BASE=/static
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ${BASE}/shared/.telegramenv ]
|
# if [ -f ${BASE}/shared/.telegramenv ]
|
||||||
then
|
# then
|
||||||
. ${BASE}/shared/.telegramenv
|
# . ${BASE}/shared/.telegramenv
|
||||||
else
|
# else
|
||||||
echo "Created ${BASE}/shared/.telegramenv"
|
# echo "Created ${BASE}/shared/.telegramenv"
|
||||||
echo "Please update contents and rerun"
|
# echo "Please update contents and rerun"
|
||||||
echo "DUFUS="" " > ${BASE}/shared/.telegramenv
|
# echo "DUFUS="" " > ${BASE}/shared/.telegramenv
|
||||||
echo "TCHATID="" " >> ${BASE}/shared/.telegramenv
|
# echo "TCHATID="" " >> ${BASE}/shared/.telegramenv
|
||||||
exit 1
|
# exit 1
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
SCRIPT=$1
|
# SCRIPT=$1
|
||||||
MSG=$2
|
# MSG=$2
|
||||||
MYNAME=`uname -n`
|
# MYNAME=`uname -n`
|
||||||
|
|
||||||
SUBJECT=" ${MYNAME} - ${SCRIPT}: "
|
# SUBJECT=" ${MYNAME} - ${SCRIPT}: "
|
||||||
|
|
||||||
DROP='{"chat_id": "'"${TCHATID}"'", "text": " '"${SUBJECT}"' '"${MSG}"'"}'
|
# DROP='{"chat_id": "'"${TCHATID}"'", "text": " '"${SUBJECT}"' '"${MSG}"'"}'
|
||||||
curl -X POST \
|
# curl -X POST \
|
||||||
-H 'content-type: application/json' \
|
# -H 'content-type: application/json' \
|
||||||
-d "${DROP}" \
|
# -d "${DROP}" \
|
||||||
https://api.telegram.org/bot${DUFUS}/sendmessage
|
# https://api.telegram.org/bot${DUFUS}/sendmessage
|
||||||
|
|
||||||
rm -f ${MSG}
|
# rm -f ${MSG}
|
||||||
|
|
||||||
|
${BASE}/shared/_nmsg $1 $2
|
||||||
Reference in New Issue
Block a user