Skip to content
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

Merged
merged 1 commit into from
Aug 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 40 additions & 18 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

@simonsmh simonsmh Aug 14, 2016

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

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/
Expand All @@ -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
Expand All @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would you remove Mac OS from here?

Copy link
Contributor Author

@simonsmh simonsmh Aug 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l62

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does that mean. (Not super experienced with shell)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 62..

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it for sure python-Devel and not python-dev?

Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Contributor

Choose a reason for hiding this comment

The 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."
Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand Down