diff --git a/src/packages/fff/fff-nodewatcher/Makefile b/src/packages/fff/fff-nodewatcher/Makefile index 12ccb0f..7f989fd 100644 --- a/src/packages/fff/fff-nodewatcher/Makefile +++ b/src/packages/fff/fff-nodewatcher/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-nodewatcher -PKG_VERSION:=48 +PKG_VERSION:=49 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher index c0ae57b..b0b67e1 100755 --- a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher +++ b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher @@ -2,10 +2,18 @@ # Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg # License; GPL v3 -SCRIPT_VERSION="48" - test -f /tmp/started || exit +# 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 + +SCRIPT_VERSION="49" + #Get the configuration from the uci configuration file #If it does not exists, then get it from a normal bash file with variables. if [ -f /etc/config/nodewatcher ];then