#!/bin/sh

# Load ipmodule variables
. /opt/gira/share/devicestack/ipmodule-vars

IPC_STRING=$1

if [ $(printf "%s\\n" "${IPC_STRING}" | grep "netcfg-" | wc -l) -eq 1 ]
then
	printf "%s" "${IPC_STRING}" > ${NETCFGSTATE}
fi

if [ -f ${DS_PIDFILE} ]
then
	if [ -d /proc/$(cat ${DS_PIDFILE}) ]
	then
		logger $(${DEVICESTACK} --ipc-send=${IPC_STRING})
	fi
fi
