aboutsummaryrefslogtreecommitdiff
path: root/lock
blob: b4b285d77fceb55933f7556e11a334d53e2c5350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
lock() {

	if ! mkdir "$1" &>/dev/null;  then
		while true; do
			sleep 2;
			if [[ ! -d "$1" ]]; then
				return
			fi
		done
	fi;

}

lock $1