-
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
Small improvements in setup.sh #3836
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,18 @@ cd $pokebotpath | |
git pull | ||
git submodule update --init --recursive | ||
git submodule foreach git pull origin master | ||
virtualenv . | ||
source bin/activate | ||
pip install -r requirements.txt --upgrade | ||
pip install -r requirements.txt | ||
} | ||
|
||
function Pokebotencrypt () { | ||
echo "Start to make encrypt.so" | ||
if [ "$(uname -s)" == "Darwin" ]; then #Mac platform | ||
curl -O http://pgoapi.com/pgoencrypt.tar.gz | ||
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then #GNU/Linux platform | ||
wget http://pgoapi.com/pgoencrypt.tar.gz | ||
echo "Start to make encrypt.so." | ||
if [ -x "$(command -v curl)" ] | ||
then | ||
curl -O http://pgoapi.com/pgoencrypt.tar.gz | ||
else | ||
wget http://pgoapi.com/pgoencrypt.tar.gz | ||
fi | ||
tar -xf pgoencrypt.tar.gz | ||
cd pgoencrypt/src/ | ||
|
@@ -43,7 +44,7 @@ Input location | |
read -p "Input gmapkey | ||
" gmapkey | ||
cp -f configs/config.json.example configs/config.json && chmod 755 configs/config.json | ||
if [ "$auth" = "2" ] | ||
if [ "$auth" = "2" ] || [ "$auth" = "ptc" ] | ||
then | ||
sed -i "s/google/ptc/g" configs/config.json | ||
fi | ||
|
@@ -56,27 +57,42 @@ echo "Edit ./configs/config.json to modify any other config." | |
|
||
function Pokebotinstall () { | ||
cd $pokebotpath | ||
if [ -f /etc/debian_version ] | ||
if [ "$(uname -s)" == "Darwin" ] | ||
then | ||
echo "You are on Mac os" | ||
sudo brew update | ||
sudo brew install --devel protobuf | ||
elif [ -x "$(command -v apt-get)" ] | ||
then | ||
echo "You are on Debian/Ubuntu" | ||
sudo apt-get update | ||
sudo apt-get -y install python python-pip python-dev build-essential git virtualenv | ||
elif [ -f /etc/redhat-release ] | ||
sudo apt-get -y install python python-pip python-dev gcc make git | ||
elif [ -x "$(command -v yum)" ] | ||
then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why would you remove Mac OS from here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. l62 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does that mean. (Not super experienced with shell) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 62.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh ok thanks |
||
echo "You are on CentOS/RedHat" | ||
sudo yum -y install epel-release | ||
sudo yum -y install python-pip | ||
elif [ "$(uname -s)" == "Darwin" ] | ||
sudo yum -y install epel-release gcc make | ||
sudo yum -y install python-pip python-devel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it for sure python-Devel and not python-dev? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nivong after a quick search, "python-devel" should be correct: http://stackoverflow.com/questions/23541205/cant-install-python-dev-on-centos-6-5 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah you are right :) |
||
elif [ -x "$(command -v pacman)" ] | ||
then | ||
echo "You are on Mac os" | ||
sudo brew update | ||
sudo brew install --devel protobuf | ||
echo "You are on Arch Linux" | ||
sudo pacman -Sy python2 python2-pip gcc make | ||
elif [ -x "$(command -v dnf)" ] | ||
then | ||
echo "You are on Fedora/RHEL" | ||
sudo dnf update | ||
sudo dnf -y install python-pip python-devel gcc make | ||
elif [ -x "$(command -v zypper)" ] | ||
then | ||
echo "You are on Open SUSE" | ||
sudo zypper update | ||
sudo zypper -y install python-pip python-devel gcc make | ||
else | ||
echo "Please check if you have python pip protobuf gcc make installed on your device." | ||
echo "Please check if you have python pip gcc make installed on your device." | ||
echo "Wait 5 seconds to continue or Use ctrl+c to interrupt this shell." | ||
sleep 5 | ||
fi | ||
sudo pip install virtualenv | ||
Pokebotreset | ||
Pokebotupdate | ||
Pokebotencrypt | ||
echo "Install complete. Starting to generate config.json." | ||
|
@@ -87,6 +103,12 @@ function Pokebotreset () { | |
cd $pokebotpath | ||
git fetch --all | ||
git reset --hard origin/dev | ||
if [ -x "$(command -v python2)" ] | ||
then | ||
virtualenv -p python2 . | ||
else | ||
virtualenv . | ||
fi | ||
Pokebotupdate | ||
} | ||
|
||
|
@@ -119,7 +141,7 @@ cp -f $pokebotpath/configs/config*.json $backuppath/ | |
cp -f $pokebotpath/configs/*.gpx $backuppath/ | ||
cp -f $pokebotpath/configs/path*.json $backuppath/ | ||
cp -f $pokebotpath/web/config/userdata.js $backuppath/ | ||
echo "Backup complete" | ||
echo "Backup complete." | ||
;; | ||
--config|-c) | ||
Pokebotconfig | ||
|
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.
Please dubble check @TheSavior this is now dubble please remove this.
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.
no its not
check #3820