setup.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. if [ $(uname -s) == "Linux" ]; then
  3. declare -a distributions=("Manjaro" "Ubuntu" "Arch");
  4. declare -a distpackagemgrs=("1" "0" "1");
  5. declare -a packagemgr=("apt-get" "pacman");
  6. dist_count=${#distributions[*]}
  7. usable_mgr="-1"
  8. dist_name=$(lsb_release -a);
  9. for (( i=0; i<=$(( $dist_count -1 )); i++ ))
  10. do
  11. if [ $(echo "$dist_name" | grep -c "${distributions[$i]}") -gt 0 ]; then
  12. usable_mgr=${distpackagemgrs[$i]}
  13. echo "Found Distribution ${distributions[$i]}, will use ${packagemgr[usable_mgr]}"
  14. fi
  15. done
  16. if [ $usable_mgr == "-1" ]; then
  17. echo "Err: Linux distibution unknown, will use apt-get"
  18. usable_mgr="0"
  19. fi
  20. case $usable_mgr in
  21. "0")
  22. echo "-- apt-get install --"
  23. sudo apt-get install python2.7-dev python-pip -y
  24. ;;
  25. "1")
  26. echo "-- pacman installation --"
  27. sudo pacman -S python2 python-pip -y
  28. ;;
  29. esac
  30. fi
  31. if [ $(uname -s) == "Darwin" ]; then
  32. sudo easy_install pip
  33. fi
  34. sudo pip2 install matplotlib
  35. sudo pip2 install networkx