tabs
This commit is contained in:
parent
d86043190d
commit
64982d1b34
@ -194,31 +194,31 @@ def vhost_remove(domain: str, sv: str, dist: str):
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
p = argparse.ArgumentParser(description='vhost helper')
|
||||
p.add_argument('domain', metavar="domain", help="vhost domain(s)", nargs="+")
|
||||
g = p.add_mutually_exclusive_group()
|
||||
g.add_argument('-a', '--add', action='store_true', help="adds vhost for given domain(s)")
|
||||
g.add_argument('-r', '--remove', action='store_true', help="removes vhost for given domain(s)")
|
||||
p = argparse.ArgumentParser(description='vhost helper')
|
||||
p.add_argument('domain', metavar="domain", help="vhost domain(s)", nargs="+")
|
||||
g = p.add_mutually_exclusive_group()
|
||||
g.add_argument('-a', '--add', action='store_true', help="adds vhost for given domain(s)")
|
||||
g.add_argument('-r', '--remove', action='store_true', help="removes vhost for given domain(s)")
|
||||
|
||||
args = p.parse_args()
|
||||
args = p.parse_args()
|
||||
|
||||
print('1. sanity checks')
|
||||
print('1. sanity checks')
|
||||
|
||||
sv, dist = sanity_check_system()
|
||||
sanity_check_platform()
|
||||
sv, dist = sanity_check_system()
|
||||
sanity_check_platform()
|
||||
|
||||
print('2. vhosting')
|
||||
print('2. vhosting')
|
||||
|
||||
for d in args.domain:
|
||||
if args.add:
|
||||
vhost_add(d, sv, dist)
|
||||
elif args.remove:
|
||||
vhost_remove(d, sv, dist)
|
||||
for d in args.domain:
|
||||
if args.add:
|
||||
vhost_add(d, sv, dist)
|
||||
elif args.remove:
|
||||
vhost_remove(d, sv, dist)
|
||||
|
||||
if y_n_question(f"Reload {sv}?"):
|
||||
if y_n_question(f"Reload {sv}?"):
|
||||
subprocess.call(['sudo', 'service', sv.lower(), 'reload'])
|
||||
|
||||
print('done.')
|
||||
|
||||
print('done.')
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user