-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.py
47 lines (38 loc) · 1.71 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
45
46
47
#!/usr/bin/python
import commands,os
check_libuv_result = commands.getstatusoutput('ls /usr/local/lib/libuv.a')
if check_libuv_result[0] != 0:
print 'Please install libuv fisrt!\n\
run "brew install libuv"'
mkdir_result = commands.getstatusoutput('mkdir -p /usr/local/proximac/')
if mkdir_result[0] != 0:
print 'Cannot create fodler!'
exit()
download_result = commands.getstatusoutput('cd /usr/local/proximac/ && curl -o proximac.zip https://raw.githubusercontent.com/proximac-org/proximac-install/master/proximac.zip')
if download_result[0] != 0:
print 'Download remote resources failed!'
exit()
download1_result = commands.getstatusoutput('cd /usr/local/bin && curl -o proximac https://raw.githubusercontent.com/proximac-org/proximac-install/master/proximac.py')
if download1_result[0] != 0:
print 'Download remote resources failed!'
exit()
chmod_result = commands.getstatusoutput('cd /usr/local/bin && chmod 777 proximac')
if chmod_result[0] != 0:
print 'Cannot chage permission!'
exit()
print 'Resources has been downloaded!'
unzip_result = commands.getstatusoutput('cd /usr/local/proximac/ && unzip -o proximac.zip')
if unzip_result[0] != 0:
print 'Unzip install files failed! Check your permission on this folder!'
exit()
print 'Now change kernel extension\'s owner'
print 'Please enter your password to obtain root priviledge'
chown_result = commands.getstatusoutput('cd /usr/local/proximac/ && sudo chown -R root:wheel proximac.kext')
if chown_result[0] != 0:
print 'command execution failed!'
exit()
os.system('cd /usr/local/proximac/ && rm -rf proximac.zip')
print 'Proximac is successfully installed!'
print 'To uninstall, just delete these files:'
print '/usr/local/proximac/* (root)'
print '/usr/local/bin/proximac'