Загрузка данных


service_is_running() {
	start-stop-daemon -q -K -t -x "$1"
}

# @brief Watch state and statistics
# @param[in] $1 - specify a different interval
l2crypto_watch() {
	local rc=0

	if ! service_is_running "$DAEMON"; then
		echo "l2crypto is not working now"
		return $rc
	else
		watch_time=1
		if [ -n "${1}" ]; then
			watch_time="${1}"
		fi

		while :; do
			echo -e "\\033c"
			/sbin/l2crypto_cli --info ""
			rc=$?
			sleep "${watch_time}"
		done
	fi

	return $rc
}