Skip to content

Commit

Permalink
easy-setup.sh: updates and cleanup (PokemonGoF#1836)
Browse files Browse the repository at this point in the history
* easy-setup.sh: updates and cleanup

  - Check for debain based OS otherwise quit.
  - Use already bundled get-pip.py over debian's.
  - Use sudo in commands instead of exiting.
  - Be a little smarter with the creation of credentials.
  - Be more verbose for the user.
  - Declare script as shell script
  - Give script executable permissions.

* easy-setup.sh: remove sudo from pip
  • Loading branch information
KhasMek authored and Chlodochar committed Jul 25, 2016
1 parent ff835fb commit 6c01f06
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions Easy Setup/easy-setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
if [ "$EUID" -ne 0 ]
then echo "Please run as root. You can also do: sudo !!"
exit
fi

apt-get install python python-pip
pip install -r requirements.txt
pip install -r requirements.txt --upgrade
echo -n "Enter your Google API key here:"

read api

echo '{' >> ../config/credentials.json
echo "gmaps_key : $api" >> ../config/credentials.json
echo '}' >> ../config/credentials.json

echo All done!
sleep 5
#!/bin/sh

echo "Installing PokemonGo-Map Requirements."
echo "This script may ask for your sudo/root password to perform the installation."
echo ""

if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then
echo "Installing python development tools..."
sudo apt-get install python python-dev
else
echo "This script only supports debain based Linux distros."
echo "Please install manually."
exit 1
fi

echo "Installing pip..."
sudo python get-pip.py
echo "Installing required python packages..."
pip install -r requirements.txt

echo "Configuring Google Maps API..."
cp ../config/credentials.json.example ../config/credentials.json
echo -n "Enter your Google Maps API key here:"
read key
sed -i -e "s/\"gmaps_key\"\ :\ \"\"/\"gmaps_key\"\ :\ \""$key"\"/g" ../config/credentials.json

echo "All done!"

0 comments on commit 6c01f06

Please sign in to comment.