-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.py
44 lines (37 loc) · 1.05 KB
/
install.py
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
#!/usr/bin/env python2
import os
import sys
import platform
def main():
if os.getuid() != 0:
print('Requires root privileges')
sys.exit('Exiting installer')
if (platform.dist()[0] == 'centos'):
os.system('''
yum update -y
yum install -y git curl
''')
elif (platform.dist()[0] == 'Ubuntu'):
os.system('''
apt-get update -y
apt-get install -y git curl
''')
else:
print('Operating system not supported')
sys.exit('Exiting installer')
os.system('''
curl -L https://bootstrap.pypa.io/get-pip.py | python2.7
git clone https://github.com/jamrizzi/bird.git
pip install future
pip install ipgetter
''')
if len(sys.argv) > 1:
if sys.argv[1] == 'master':
os.system('python2 ./bird/src/master.py')
elif sys.argv[1] == 'node':
os.system('python2 ./bird/src/node.py')
else:
print('No command given')
sys.exit('Exiting installer')
os.system('rm -rf ./install.py ./bird')
main()