work in progress

This commit is contained in:
.[d]. 2022-08-08 09:19:02 -05:00
parent a934f321b0
commit d243206439

184
runbot.sh

@ -1,20 +1,166 @@
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
exec $SHELL
which python3 > /dev/null 2>&1
if [ $? -eq 1 ]; then
echo "<<< error: missing python3 >>> - to continue install python3 first; aborting"
exit
fi
#####################################################################################################################################
python3 -n pip > /dev/null 2>&1
if [ $? -eq 1 ]; then
echo "<<< error: missing python3 pip module>>> - to continue install python3 pip module first; aborting"
exit
fi
#####################################################################################################################################
python3 -n pipenv > /dev/null 2>&1
if [ $? -eq 1 ]; then
echo "<<< error: missing python3 pipenv module >>> - attempting to auto-install"
python3 -m pip install pipenv
python3 -n pipenv > /dev/null 2>&1
#############################################################################################################################
if [ $? -eq 1 ]; then
echo "<<< error: still missing python3 pipenv module >>> - to continue install python3 pipenv module first; aborting"
exit
fi
#############################################################################################################################
fi
#####################################################################################################################################
which pyenv > /dev/null 2>&1
if [ $? -eq 1 ]; then
echo "<<< error: missing pyenv >>> - attempting to auto-install"
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$HOME/.local/bin:$PATH"
eval "$(pyenv init -)"
which pyenv > /dev/null 2>&1
#############################################################################################################################
if [ $? -eq 1 ]; then
echo "<<< error: still missing pyenv >>> - to continue install pyenv first; aborting"
exit
fi
#############################################################################################################################
fi
#####################################################################################################################################
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$HOME/.local/bin:$PATH"
eval "$(pyenv init -)"
#####################################################################################################################################
pyenv update
mkdir .venv
pipenv --python 3.7
pipenv install
echo "export BOT_SASL_USERNAME=your_nickserv_username" >> .venv/bin/activate
echo "export BOT_SASL_PASSWORD=your_nickserv_password" >> .venv/bin/activate
echo "export NICKSERV_USERNAME=your_nickserv_username" >> .venv/bin/activate
echo "export NICKSERV_PASSWORD=your_nickserv_password" >> .venv/bin/activate
echo "export MATRIX_HOMESERVER=https://matrix.org" >> .venv/bin/activate
echo "export MATRIX___USERNAME=your_matrix_username" >> .venv/bin/activate
echo "export MATRIX___PASSWORD=your_matrix_password" >> .venv/bin/activate
echo "export DEVELOPER_KEY=1394823190182390182382383215382158321" >> .venv/bin/activate
echo "export CONSUMER_KEY=2151235132512351235123512351325231" >> .venv/bin/activate
echo "export CONSUMER_SECRET=514512521345234523452345234523452345234523452" >> .venv/bin/activate
echo "export ACCESS_TOKEN_KEY=24513429875209348502934850294898348034850293485203948592" >> .venv/bin/activate
echo "export ACCESS_TOKEN_SECRET=523490582034985203948520394804884820934850923485" >> .venv/bin/activate
echo "export PYTHONASYNCIODEBUG=1" >> .venv/bin/activate
pipenv run bot.py
#####################################################################################################################################
if [ -f ".venv" ]; then
if [ -f ".venv/bin/activate" ]; then
#####################################################################################################################
cat .venv/bin/activate|grep BOT_SASL_USERNAME
if [ $? -eq 1 ]; then
echo "export BOT_SASL_USERNAME=your_nickserv_username" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep BOT_SASL_PASSWORD
if [ $? -eq 1 ]; then
echo "export BOT_SASL_PASSWORD=your_nickserv_password" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep NICKSERV_USERNAME
if [ $? -eq 1 ]; then
echo "export NICKSERV_USERNAME=your_nickserv_username" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep NICKSERV_PASSWORD
if [ $? -eq 1 ]; then
echo "export NICKSERV_PASSWORD=your_nickserv_username" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep MATRIX_HOMESERVER
if [ $? -eq 1 ]; then
echo "export MATRIX_HOMESERVER=https://matrix.org" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep MATRIX___USERNAME
if [ $? -eq 1 ]; then
echo "export MATRIX___USERNAME=your_matrix_username" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep MATRIX___PASSWORD
if [ $? -eq 1 ]; then
echo "export MATRIX___PASSWORD=your_matrix_password" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep DEVELOPER_KEY
if [ $? -eq 1 ]; then
echo "export DEVELOPER_KEY=1394823190182390182382383215382158321" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep CONSUMER_KEY
if [ $? -eq 1 ]; then
echo "export CONSUMER_KEY=2151235132512351235123512351325231" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep CONSUMER_SECRET
if [ $? -eq 1 ]; then
echo "export CONSUMER_SECRET=514512521345234523452345234523452345234523452" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep ACCESS_TOKEN_KEY
if [ $? -eq 1 ]; then
echo "export ACCESS_TOKEN_KEY=24513429875209348502934850294898348034850293485203948592" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep ACCESS_TOKEN_SECRET
if [ $? -eq 1 ]; then
echo "export ACCESS_TOKEN_SECRET=523490582034985203948520394804884820934850923485" >> .venv/bin/activate
fi
#####################################################################################################################
cat .venv/bin/activate|grep PYTHONASYNCIODEBUG
if [ $? -eq 1 ]; then
echo "export PYTHONASYNCIODEBUG=1" >> .venv/bin/activate
fi
#####################################################################################################################
#############################################################################################################################
else
mv .venv .backup_venv
pipenv --python 3.9
pipenv install
pipenv run maple
fi
#############################################################################################################################
#####################################################################################################################################
else
#####################################################################################################################################
#############################################################################################################################
mkdir .venv
pipenv --python 3.9
pipenv install
pipenv run maple
#############################################################################################################################
#####################################################################################################################################
fi
#####################################################################################################################################
pipenv run maple
#####################################################################################################################################