mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2025-01-03 08:58:32 +00:00
16 lines
476 B
Python
16 lines
476 B
Python
#!/usr/bin/env python
|
|
import argparse
|
|
import os
|
|
import webbrowser
|
|
|
|
parser = argparse.ArgumentParser(description='Butterfly session opener.')
|
|
parser.add_argument(
|
|
'session',
|
|
help='Open or rattach a butterfly session. '
|
|
'(Only in secure mode or in user unsecure mode (no su login))')
|
|
args = parser.parse_args()
|
|
|
|
url = '%ssession/%s' % (os.getenv('LOCATION', '/'), args.session)
|
|
if not webbrowser.open(url):
|
|
print('Unable to open browser, please go to %s' % url)
|