forked from laudarch/Shellsploit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
38 lines (33 loc) · 1.1 KB
/
setup.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
from optparse import OptionParser
from os import system
from os import path
from os import unlink
from sys import exit
if __name__ == '__main__':
parser = OptionParser()
parser.add_option('-s', '--setup', action="store")
parser.add_option('--user', action="store_true")
options, args = parser.parse_args()
if not options.setup:
exit("\n\tUsage : setup.py -s/--setup install or uninstall ..\n")
else:
if options.setup == 'install':
if options.user:
system('python easyinstall.py install --record shellsploit.ini --user')
else:
system('python easyinstall.py install --record shellsploit.ini')
elif options.setup == 'uninstall':
if not path.isfile('shellsploit.ini'):
exit('\n\tIf you want uninstall you must install it first.\n')
else:
files = open('shellsploit.ini', 'r').readlines()
unlink('shellsploit.ini')
print ('')
for x in files:
if path.isfile(x.strip()):
print ('Remove : {0}').format(x.strip())
unlink(x.strip())
else:
exit('\nUninstall complate ! \n')
else:
exit("\n\tUsage : setup.py -s/--setup install or uninstall ..\n")