#! /bin/sh
printf "Content-Type: text/plain\r\n\r\n"

num=$(echo $QUERY_STRING|sed -e 's/[^0-9]//')
reply=$(server-request 4000 "LOCK-DEVICE ${num} ${REMOTE_ADDR}")
if [ "${reply%% *}" = "Ok" ]
then
	echo "${reply##* }"
else
	echo "0"
fi

