2020-06-08 13:48:07 +00:00
|
|
|
#!/bin/bash
|
2021-01-01 10:27:54 +00:00
|
|
|
#
|
2020-06-08 13:48:07 +00:00
|
|
|
# joke hack to obfuscate bashbot.min.sh
|
2021-01-01 10:27:54 +00:00
|
|
|
#
|
2021-01-03 21:39:36 +00:00
|
|
|
#### $$VERSION$$ v1.21-0-gc85af77
|
2021-01-01 10:27:54 +00:00
|
|
|
# shellcheck disable=SC2028,SC2016,SC1117
|
2020-06-08 13:48:07 +00:00
|
|
|
|
|
|
|
infile="bashbot.sh"
|
|
|
|
outfile="./bashbot.obf.sh"
|
|
|
|
|
2021-01-01 10:27:54 +00:00
|
|
|
if [ ! -f "${infile}" ]; then
|
|
|
|
printf "This is a hack to obfuscate %s, run me in STANDALONE after running make-standalone.sh\n" "${infile}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
# create gzipped base64 encoded file plus commands to decode
|
2020-06-08 13:48:07 +00:00
|
|
|
{
|
2021-01-01 10:27:54 +00:00
|
|
|
# shellcheck disable=SC2183
|
|
|
|
printf '#!/bin/bash\na="$PWD";cd "$(mktemp -d)"||exit;%s'\
|
2021-01-03 21:39:36 +00:00
|
|
|
'printf '"'$(gzip -9 <"${infile}" | base64)'"'|base64 -d|gunzip >a;export BASHBOT_HOME="$a";chmod +x a;./a "$@";a="$PWD";cd ..;rm -rf "$a"'
|
2020-06-08 13:48:07 +00:00
|
|
|
} >"${outfile}"
|
|
|
|
|
|
|
|
chmod +x "${outfile}"
|
|
|
|
ls -l "${outfile}"
|
2021-01-01 10:27:54 +00:00
|
|
|
printf "Try to run %s init ;-)\n" "${outfile}"
|