#!/bin/bash

killall -s SIGUSR1 sduibin 2>/dev/null
sduibin
returncode=$?
activecode=""
while [ $returncode == 127 ] || [ $returncode == 126 ]
do
	if [ $returncode == 126 ]
	then
		echo "enter active code:"
		read activecode
		if [ ${#activecode} -gt 32 ]
		then
			echo "$activecode" > /etc/safedog/server/active.lcs
			sdcmd active
		fi
	fi


	sduibin
	returncode=$?
done

