Skip to content

Commit

Permalink
Improved cmdline startup logic, introduce main() and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
brightio committed Oct 28, 2023
1 parent 81fd313 commit 70d141a
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions penelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

__program__= "penelope"
__version__ = "0.9.2"
__version__ = "0.10.0"

import os
import io
Expand Down Expand Up @@ -3461,31 +3461,35 @@ def listener_menu():
listener_menu.finishing.set()
return True

def main():

# MAIN
if __name__ == "__main__":

# Version
if options.version:
print(__version__)
return

# Interfaces
elif options.interfaces:
print(Interfaces())
return

# Main Menu
elif options.plain:
menu.show()
return

elif options.connect:
Connect(options.connect, options.ports[0])
if not options.ports:
options.ports.append(options.port)

else:
if options.ports:
for port in options.ports:
Listener(port=port)
if options.plain:
menu.show()
else:
listener_menu()
for port in options.ports:
# Bind shell
if options.connect:
Connect(options.connect, port)
# Reverse Listener
else:
if options.plain:
menu.show()
else:
Listener()
listener_menu()
Listener(port=port)

listener_menu()

if __name__ == "__main__":
main()

0 comments on commit 70d141a

Please sign in to comment.