try to load prefix from ENV

master
agp8x 2020-06-22 09:36:01 +02:00
parent d100f5e255
commit 1a61503eb5
2 changed files with 5 additions and 3 deletions

View File

@ -13,7 +13,7 @@ Examples:
* start services (up -d) `python3 discover.py /srv/services/ /opt/docker/testing/` * start services (up -d) `python3 discover.py /srv/services/ /opt/docker/testing/`
* which services are configured for autostart? `python3 discover.py -l /srv/services/ /opt/docker/testing/` * which services are configured for autostart? `python3 discover.py -l /srv/services/ /opt/docker/testing/`
* check status `python3 discover.py -a ps /opt/docker/testing/` * check status `python3 discover.py -a ps /opt/docker/testing/`
* stop services `python3 discover.py -a "down -v /srv/testing/` * stop services `python3 discover.py -a "down -v" /srv/testing/`
### pre/post exec ### pre/post exec

View File

@ -62,6 +62,8 @@ if __name__ == "__main__":
if args.key: if args.key:
PREFIX = args.key PREFIX = args.key
else:
PREFIX = os.getenv('DISCOVER_PREFIX', PREFIX)
services = find_services(args.service_dir) services = find_services(args.service_dir)
autostarts = find_autostart_services(services) autostarts = find_autostart_services(services)
if args.list: if args.list: