fix help if not in bashbot dir

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-08-05 08:08:50 +02:00
parent 4ab8ebd298
commit b9c8dc0ff8
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ 0.99-7-gafbdb1e
#### $$VERSION$$ 0.99-9-g4ab8ebd
#
# Exit Codes:
# - 0 success (hopefully)
@ -109,7 +109,7 @@ fi
BOTCOMMANDS="start, stop, status, help, init, stats, broadcast, suspendback, resumeback, killback"
[[ -z "$1" && -z "${SOURCE}" ]] && echo -e "${ORANGE}Available commands: ${GREY}${BOTCOMMANDS}${NC}" && exit
if [ "$1" = "help" ]; then
HELP="README"
HELP="${BASHBOT_HOME:-.}/README"
if [ -n "${CLEAR}" ];then
_exists w3m && w3m "$HELP.html" && exit
_exists lynx && lynx "$HELP.html" && exit

View File

@ -9,8 +9,8 @@ outfile="./bashbot.obf.sh"
{
echo '#!/bin/bash'
echo 'b="./bashbot";h="$PWD";cd "$(mktemp -d)"||exit'
echo 'printf '"'%s\n'"' '"'$(gzip -9 <bashbot.sh | base64)'"'|base64 -d|gunzip >"$b";export BASHBOT_HOME="$h";chmod +x "$b";"$b" "$@";b="$(pwd)";cd ..;rm -rf "$b"'
echo 'a="$PWD";cd "$(mktemp -d)"||exit'
echo 'printf '"'%s\n'"' '"'$(gzip -9 <bashbot.sh | base64)'"'|base64 -d|gunzip >a;export BASHBOT_HOME="$a";chmod +x a;./a "$@";a="$PWD";cd ..;rm -rf "$a"'
} >"${outfile}"
chmod +x "${outfile}"