-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Powerful setup.sh #3263
Merged
Merged
Powerful setup.sh #3263
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
82e8598
Rewrite run.sh
simonsmh 6d967fa
Update run.sh
simonsmh 122a90b
Update run.sh
simonsmh b91851a
Delete setup.py
simonsmh 212139a
Rename run.sh to setup.sh
simonsmh 94dffc9
Create run.sh
simonsmh 5ae8d75
Update setup.sh
simonsmh eee2660
Update install.sh
simonsmh 0c4bbb1
Update setup.sh
simonsmh 6f51490
Update run.sh
simonsmh 34d1657
Update setup.sh
simonsmh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,62 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Setup Python virtualenv | ||
echo "Setting up Python virtualenv..." | ||
eval "virtualenv ." | ||
eval "source bin/activate" | ||
echo "Python virtualenv setup successfully." | ||
|
||
# Install pip requirements | ||
echo "Installing pip requirements..." | ||
eval "pip install -r requirements.txt" | ||
echo "Installed pip requirements." | ||
echo "Installing and updating git submodules..." | ||
|
||
# Install git submodules | ||
eval "cd ./web && git submodule init && cd .." | ||
eval "git submodule update" | ||
echo "Done." | ||
echo "Please create and setup configs/config.json. Then, run 'python pokecli.py --config ./configs/config.json' or './run.sh' on Mac/Linux" | ||
pokebotpath=$(pwd) | ||
cd $pokebotpath | ||
if [ -f /etc/debian_version ] | ||
then | ||
echo "You are on Debian/Ubuntu" | ||
sudo apt-get update | ||
sudo apt-get -y install python python-pip python-dev build-essential git python-protobuf virtualenv | ||
elif [ -f /etc/redhat-release ] | ||
then | ||
echo "You are on CentOS/RedHat" | ||
sudo yum -y install epel-release | ||
sudo yum -y install python-pip | ||
elif [ "$(uname -s)" == "Darwin" ] | ||
then | ||
echo "You are on Mac os" | ||
sudo brew update | ||
sudo brew install --devel protobuf | ||
else | ||
echo "Nothing happend." | ||
fi | ||
pip install virtualenv | ||
cd $pokebotpath | ||
git pull | ||
git submodule init | ||
git submodule foreach git pull origin master | ||
virtualenv . | ||
source bin/activate | ||
pip install -r requirements.txt | ||
echo "Start to make encrypt.so" | ||
wget http://pgoapi.com/pgoencrypt.tar.gz | ||
tar -xf pgoencrypt.tar.gz | ||
cd pgoencrypt/src/ | ||
make | ||
mv libencrypt.so $pokebotpath/encrypt.so | ||
cd ../.. | ||
rm -rf pgoencrypt.tar.gz | ||
rm -rf pgoencrypt | ||
echo "Install complete." | ||
cd $pokebotpath | ||
read -p "1.google 2.ptc | ||
" auth | ||
read -p "Input username | ||
" username | ||
read -p "Input password | ||
" -s password | ||
read -p " | ||
Input location | ||
" location | ||
read -p "Input gmapkey | ||
" gmapkey | ||
cp configs/config.json.example configs/config.json | ||
if [ "$auth" = "2" ] | ||
then | ||
sed -i "s/google/ptc/g" configs/config.json | ||
fi | ||
sed -i "s/YOUR_USERNAME/$username/g" configs/config.json | ||
sed -i "s/YOUR_PASSWORD/$password/g" configs/config.json | ||
sed -i "s/SOME_LOCATION/$location/g" configs/config.json | ||
sed -i "s/GOOGLE_MAPS_API_KEY/$gmapkey/g" configs/config.json | ||
echo "Edit configs/config.json to modify any other config. Use run.sh to run." | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Starts PokemonGo-Bot | ||
config="" | ||
|
||
pokebotpath=$(pwd) | ||
filename="" | ||
if [ ! -z $1 ]; then | ||
config=$1 | ||
filename=$1 | ||
else | ||
config="./configs/config.json" | ||
if [ ! -f ${config} ]; then | ||
echo -e "There's no ./configs/config.json file" | ||
echo -e "Please create one or use another config file" | ||
echo -e "./run.sh [path/to/config/file]" | ||
exit 1 | ||
fi | ||
filename="./configs/config.json" | ||
if [ ! -f "$filename" ] | ||
then | ||
echo "There's no "$filename" file. use setup.sh -config to creat one." | ||
fi | ||
fi | ||
|
||
while [ true ] | ||
while true | ||
do | ||
echo "###############################################" | ||
echo "##Exit two times with [Ctl+C] to end the loop##" | ||
echo "###############################################" | ||
sleep 1 | ||
python pokecli.py --config ${config} | ||
sleep "10" | ||
cd $pokebotpath | ||
python pokecli.py -cf $filename | ||
read -p "Press any button or wait 20 seconds." -r -s -n1 -t 20 | ||
echo `date`"Pokebot"$*" Stopped." | ||
done | ||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
#!/usr/bin/env bash | ||
pokebotpath=$(pwd) | ||
backuppath=$(pwd)"/backup" | ||
|
||
function Pokebotupdate () { | ||
cd $pokebotpath | ||
git pull | ||
git submodule init | ||
git submodule foreach git pull origin master | ||
virtualenv . | ||
source bin/activate | ||
pip install -r requirements.txt | ||
} | ||
|
||
function Pokebotencrypt () { | ||
echo "Start to make encrypt.so" | ||
wget http://pgoapi.com/pgoencrypt.tar.gz | ||
tar -xf pgoencrypt.tar.gz | ||
cd pgoencrypt/src/ | ||
make | ||
mv libencrypt.so $pokebotpath/encrypt.so | ||
cd ../.. | ||
rm -rf pgoencrypt.tar.gz | ||
rm -rf pgoencrypt | ||
} | ||
|
||
function Pokebotconfig () { | ||
cd $pokebotpath | ||
read -p "1.google 2.ptc | ||
" auth | ||
read -p "Input username | ||
" username | ||
read -p "Input password | ||
" -s password | ||
read -p " | ||
Input location | ||
" location | ||
read -p "Input gmapkey | ||
" gmapkey | ||
cp configs/config.json.example configs/config.json | ||
if [ "$auth" = "2" ] | ||
then | ||
sed -i "s/google/ptc/g" configs/config.json | ||
fi | ||
sed -i "s/YOUR_USERNAME/$username/g" configs/config.json | ||
sed -i "s/YOUR_PASSWORD/$password/g" configs/config.json | ||
sed -i "s/SOME_LOCATION/$location/g" configs/config.json | ||
sed -i "s/GOOGLE_MAPS_API_KEY/$gmapkey/g" configs/config.json | ||
echo "Edit configs/config.json to modify any other config." | ||
} | ||
|
||
function Pokebotinstall () { | ||
cd $pokebotpath | ||
if [ -f /etc/debian_version ] | ||
then | ||
echo "You are on Debian/Ubuntu" | ||
sudo apt-get update | ||
sudo apt-get -y install python python-pip python-dev build-essential git python-protobuf virtualenv | ||
elif [ -f /etc/redhat-release ] | ||
then | ||
echo "You are on CentOS/RedHat" | ||
sudo yum -y install epel-release | ||
sudo yum -y install python-pip | ||
elif [ "$(uname -s)" == "Darwin" ] | ||
then | ||
echo "You are on Mac os" | ||
sudo brew update | ||
sudo brew install --devel protobuf | ||
else | ||
echo "Nothing happend." | ||
fi | ||
sudo pip install virtualenv | ||
Pokebotupdate | ||
Pokebotencrypt | ||
echo "Install complete." | ||
Pokebotconfig | ||
} | ||
|
||
function Pokebotreset () { | ||
cd $pokebotpath | ||
git fetch --all | ||
git reset --hard origin/dev | ||
Pokebotupdate | ||
} | ||
|
||
function Pokebothelp () { | ||
echo "usage:" | ||
echo " -i,--install. Install PokemonGo-Bot." | ||
echo " -b,--backup. Backup config files." | ||
echo " -c,--config. Easy config generator." | ||
echo " -e,--encrypt. Make encrypt.so." | ||
echo " -r,--reset. Force sync dev branch." | ||
echo " -u,--update. Command git pull to update." | ||
} | ||
|
||
case $* in | ||
--install|-i) | ||
Pokebotinstall | ||
;; | ||
--encrypt|-e) | ||
Pokebotencrypt | ||
;; | ||
--reset|-r) | ||
Pokebotreset | ||
;; | ||
--update|-u) | ||
Pokebotupdate | ||
;; | ||
--backup|-b) | ||
mkdir $backuppath | ||
cp -f $pokebotpath/configs/config*.json $backuppath/ | ||
cp -f $pokebotpath/web/config/userdata.js $backuppath/ | ||
echo "Backup complete" | ||
;; | ||
--config|-c) | ||
Pokebotconfig | ||
;; | ||
--help|-h) | ||
Pokebothelp | ||
;; | ||
*.json) | ||
filename=$* | ||
cd $pokebotpath | ||
if [ ! -f ./configs/"$filename" ] | ||
then | ||
echo "There's no ./configs/"$filename" file. It's better to use run.sh not this one." | ||
else | ||
Pokebotrun | ||
fi | ||
;; | ||
*) | ||
Pokebothelp | ||
;; | ||
esac | ||
exit 0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is still needed for multiple configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I will revert it.