mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-29 10:43:53 +00:00
fix call from outside install dir
This commit is contained in:
parent
4297fc164b
commit
dbb6caf667
@ -11,7 +11,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.90-rc1-1-g46271cc
|
#### $$VERSION$$ v0.90-rc1-3-g4297fc1
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 sucess (hopefully)
|
# - 0 sucess (hopefully)
|
||||||
@ -44,6 +44,7 @@ if [ "${SCRIPT}" != "${REALME}" ] || [ "$1" = "source" ]; then
|
|||||||
SOURCE="yes"
|
SOURCE="yes"
|
||||||
else
|
else
|
||||||
SCRIPT="./$(basename "${SCRIPT}")"
|
SCRIPT="./$(basename "${SCRIPT}")"
|
||||||
|
MODULEDIR="./$(basename "${MODULEDIR}")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$BASHBOT_HOME" != "" ]; then
|
if [ "$BASHBOT_HOME" != "" ]; then
|
||||||
@ -59,6 +60,8 @@ RUNUSER="${USER}" # USER is overwritten by bashbot array
|
|||||||
if [ "${SOURCE}" != "yes" ] && [ "$BASHBOT_HOME" = "" ] && ! cd "${RUNDIR}" ; then
|
if [ "${SOURCE}" != "yes" ] && [ "$BASHBOT_HOME" = "" ] && ! cd "${RUNDIR}" ; then
|
||||||
echo -e "${RED}ERROR: Can't change to ${RUNDIR} ...${NC}"
|
echo -e "${RED}ERROR: Can't change to ${RUNDIR} ...${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
RUNDIR="."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -w "." ]; then
|
if [ ! -w "." ]; then
|
||||||
@ -153,7 +156,6 @@ else
|
|||||||
source "${COMMANDS}" "source"
|
source "${COMMANDS}" "source"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# BASHBOT INTERNAL functions
|
# BASHBOT INTERNAL functions
|
||||||
# $1 URL, $2 filename in DATADIR
|
# $1 URL, $2 filename in DATADIR
|
||||||
|
Loading…
Reference in New Issue
Block a user