Last active
April 19, 2019 11:52
-
-
Save Awan/b6524cfdbc8ed419cac4f62e2e53f094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import os | |
import argparse | |
prs = argparse.ArgumentParser() | |
prs.add_argument('-i', '--install', action='store_true') | |
prs.add_argument('-r', '--remove', action='store_true') | |
prs.add_argument('-u', '--update', action='store_true') | |
prs.add_argument('-d', '--depinst', action='store_true') | |
prs.add_argument('package', type=str, help='Package name, nmap, zenmap etc') | |
args = prs.parse_args() | |
if args.install: | |
subprocess.check_output(['sudo', 'prt-get', 'install', args.package]) | |
if args.remove: | |
subprocess.check_output(['sudo', 'prt-get', 'remove', args.package]) | |
if args.update: | |
subprocess.check_output(['sudo', 'prt-get', 'update', args.package]) | |
if args.depinst: | |
subprocess.check_output(['sudo', 'prt-get', 'depinst', args.package]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment