forked from freifunk-franken/firmware
configurehood: Prevent multiple instances at the same time
This is based on a similar patch from Tim Niemeyer. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Reviewed-by: Robert Langhammer <rlanghammer@web.de> Reviewed-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
parent
2f7e8a18d8
commit
e5d3335c72
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-hoods
|
||||
PKG_VERSION:=3
|
||||
PKG_VERSION:=4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Allow only one instance
|
||||
lockfile="/var/lock/${0##*/}.lock"
|
||||
if ! lock -n "$lockfile"; then
|
||||
echo "Only one instance of $0 allowed."
|
||||
exit 1
|
||||
fi
|
||||
trap "lock -u \"$lockfile\"" INT TERM EXIT
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions/fff/keyxchange
|
||||
. /lib/functions/fff/network
|
||||
|
|
Loading…
Reference in New Issue