over-env/bin/till
2017-04-10 11:10:34 +02:00

28 lines
463 B
Python
Executable file

#! /usr/bin/env python3
# encoding: utf-8
import os
import sys
import time
locks = set(sys.argv[1:])
locks_to_remove = set()
print(">>> Active locks: %s" %(", ".join(locks)))
while locks:
for lock in locks:
if not os.path.exists(lock):
print("--- Releasing %s" %(lock))
locks_to_remove.add(lock)
for lock in locks_to_remove:
locks.remove(lock)
locks_to_remove.clear()
if locks:
time.sleep(5)
print("<<< All locks have been released.")