forked from jamalshahverdiev/master-slave-dns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
python-installer.sh
executable file
·82 lines (78 loc) · 2.95 KB
/
python-installer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
OSBSD=`uname -s`
FVER=`uname -r | cut -f1 -d'.'`
if [ "$OSBSD" == "FreeBSD" ] && [ "$FVER" = "10" ]
then
if [ -f /usr/local/bin/python3.4 ] && [ -f /usr/local/bin/python2.7 ]
then
echo "You have installed Python2.7 and Python3.4"
exit 0
else
/usr/sbin/pkg install -y bash vim bash-completion
/usr/sbin/pkg install -y python27 python34
/usr/local/bin/python3.4 -m ensurepip
/usr/local/bin/python3.4 -m pip install --upgrade pip
/usr/local/bin/python3.4 -m pip install fabric
/usr/local/bin/python3.4 -m pip install netmiko
/usr/local/bin/python3.4 -m pip install pexpect
/usr/local/bin/python3.4 -m pip install Jinja2
/usr/local/bin/python2.7 -m ensurepip
/usr/local/bin/python2.7 -m pip install --upgrade pip
/usr/local/bin/python2.7 -m pip install fabric
/usr/local/bin/python2.7 -m pip install netmiko
/usr/local/bin/python2.7 -m pip install pexpect
/usr/local/bin/python2.7 -m pip install Jinja2
fi
else
echo "****************************"
echo "This is not FreeBSD server"
echo "****************************"
echo -e "\n"
fi
if [ -f /etc/issue ] && [ -f /etc/redhat-release ]
then
if [ -f /usr/local/bin/python3.4 ] && [ -f /usr/local/bin/python2.7 ]
then
echo "You have installed Python2.7 and Python3.4"
exit 0
else
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel gcc wget
cd /usr/src
wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
tar xzf Python-2.7.10.tgz
cd Python-2.7.10
./configure
make && make altinstall
echo "*************************************"
echo "Python2.7 already installed"
echo "*************************************"
cd /usr/src
wget https://www.python.org/ftp/python/3.4.4/Python-3.4.4rc1.tgz
tar xzf Python-3.4.4rc1.tgz
cd Python-3.4.4rc1
./configure
make && make altinstall
/usr/local/bin/python3.4 -m ensurepip
/usr/local/bin/python3.4 -m pip install --upgrade pip
/usr/local/bin/python3.4 -m pip install fabric
/usr/local/bin/python3.4 -m pip install netmiko
/usr/local/bin/python3.4 -m pip install pexpect
/usr/local/bin/python3.4 -m pip install Jinja2
/usr/local/bin/python2.7 -m ensurepip
/usr/local/bin/python2.7 -m pip install --upgrade pip
/usr/local/bin/python2.7 -m pip install fabric
/usr/local/bin/python2.7 -m pip install netmiko
/usr/local/bin/python2.7 -m pip install pexpect
/usr/local/bin/python2.7 -m pip install Jinja2
fi
else
echo "****************************"
echo "This is not CentOS server"
echo "****************************"
echo -e "\n"
fi
#if [ "$#" == 0 ] || [ "$#" -gt 1 ]
#then
# echo "hello"
#fi