[GH-ISSUE #52] small suggestion #42

Closed
opened 2026-02-26 04:30:19 +03:00 by kerem · 0 comments
Owner

Originally created by @doomedraven on GitHub (Nov 20, 2016).
Original GitHub issue: https://github.com/LionSec/katoolin/issues/52

@LionSec
it probably would be much easier for you to maintain it, change this

if opcion2 == "1":
    cmd = os.system("apt-get install acccheck")
elif opcion2 == "2":
    cmd = os.system("apt-get install ace-voip")
elif opcion2 == "3":
    cmd = os.system("apt-get install amap")
elif opcion2 == "4":
    cmd = os.system("apt-get install automater")
elif opcion2 == "5":
    cmd = os.system("wget http://www.morningstarsecurity.com/downloads/bing-ip2hosts-0.4.tar.gz && tar -xzvf binbing-ip2hosts-0.4/bing-ip2hosts /usr/local/bin/")
  • to
command_map = {
    "1": os.system("apt-get install acccheck"),
    "2": os.system("apt-get install ace-voip"),
    "3": os.system("apt-get install amap"),
    "4": os.system("apt-get install automater"),
    "5": os.system("wget http://www.morningstarsecurity.com/downloads/bing-ip2hosts-0.4.tar.gz && tar -xzvf binbing-ip2hosts-0.4/bing-ip2hosts /usr/local/bin/"),
}

if option2 in command_map
    cmd = command_map[option2]
Originally created by @doomedraven on GitHub (Nov 20, 2016). Original GitHub issue: https://github.com/LionSec/katoolin/issues/52 @LionSec it probably would be much easier for you to maintain it, change this ``` if opcion2 == "1": cmd = os.system("apt-get install acccheck") elif opcion2 == "2": cmd = os.system("apt-get install ace-voip") elif opcion2 == "3": cmd = os.system("apt-get install amap") elif opcion2 == "4": cmd = os.system("apt-get install automater") elif opcion2 == "5": cmd = os.system("wget http://www.morningstarsecurity.com/downloads/bing-ip2hosts-0.4.tar.gz && tar -xzvf binbing-ip2hosts-0.4/bing-ip2hosts /usr/local/bin/") ```` * to ``` command_map = { "1": os.system("apt-get install acccheck"), "2": os.system("apt-get install ace-voip"), "3": os.system("apt-get install amap"), "4": os.system("apt-get install automater"), "5": os.system("wget http://www.morningstarsecurity.com/downloads/bing-ip2hosts-0.4.tar.gz && tar -xzvf binbing-ip2hosts-0.4/bing-ip2hosts /usr/local/bin/"), } if option2 in command_map cmd = command_map[option2] ```
kerem closed this issue 2026-02-26 04:30:19 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/katoolin-LionSec#42
No description provided.