move old logfiles to logs on init
This commit is contained in:
parent
d8cff8f70e
commit
d85c7794a9
12
bashbot.sh
12
bashbot.sh
|
@ -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.98-1-ga127387
|
#### $$VERSION$$ v0.98-0-g487deee
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 success (hopefully)
|
# - 0 success (hopefully)
|
||||||
|
@ -79,7 +79,7 @@ log_error(){
|
||||||
export BASHBOTDEBUG
|
export BASHBOTDEBUG
|
||||||
[[ "${3}" == *"debug"* ]] && BASHBOTDEBUG="yes"
|
[[ "${3}" == *"debug"* ]] && BASHBOTDEBUG="yes"
|
||||||
debug_checks(){
|
debug_checks(){
|
||||||
[ -n "${BASHBOTDEBUG}" ] && return
|
[ -z "${BASHBOTDEBUG}" ] && return
|
||||||
local DATE WHERE MYTOKEN; DATE="$(date)"; WHERE="${1}"; shift
|
local DATE WHERE MYTOKEN; DATE="$(date)"; WHERE="${1}"; shift
|
||||||
printf "%s: debug_checks: %s: bashbot.sh %s\n" "${DATE}" "${WHERE}" "${@##*/}"
|
printf "%s: debug_checks: %s: bashbot.sh %s\n" "${DATE}" "${WHERE}" "${@##*/}"
|
||||||
MYTOKEN="$(getConfigKey "bottoken")"
|
MYTOKEN="$(getConfigKey "bottoken")"
|
||||||
|
@ -988,7 +988,13 @@ bot_init() {
|
||||||
done
|
done
|
||||||
echo "Done."
|
echo "Done."
|
||||||
if [[ ! -d "logs" ]]; then
|
if [[ ! -d "logs" ]]; then
|
||||||
mkdir logs
|
echo "Move Logfiles ..."
|
||||||
|
mkdir logs 2>/dev/null
|
||||||
|
for MVLOG in DEBUG.log MESSAGE.log ERROR.log BASHBOT.log
|
||||||
|
do
|
||||||
|
[ -f "${MVLOG}" ] && mv "${MVLOG}" logs 2>/dev/null
|
||||||
|
done
|
||||||
|
echo "Done."
|
||||||
fi
|
fi
|
||||||
#setup bashbot
|
#setup bashbot
|
||||||
[[ "${UID}" -eq "0" ]] && RUNUSER="nobody"
|
[[ "${UID}" -eq "0" ]] && RUNUSER="nobody"
|
||||||
|
|
Loading…
Reference in New Issue