| #!/bin/bash |
| # Copyright 2015 The Vanadium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style |
| # license that can be found in the LICENSE file. |
| |
| # Starts an instance of measured and required services. |
| |
| set -eu |
| |
| source "${JIRI_ROOT}/experimental/projects/sensorlog_lite/src/v.io/x/sensorlog_lite/scripts/runner_lib.sh" |
| |
| # Must be run with V23_CREDENTIALS set or through the agent. |
| # Optional environment variables: SL_BLESSNAME, SL_NAME, SL_IPADDR_PORT, SL_TMPDIR |
| function main() { |
| local -r BLESSNAME="${SL_BLESSNAME:-sluser}" |
| local -r NAME="${SL_NAME:-measured1}" |
| local -r IPADDR_PORT="${SL_IPADDR_PORT:-127.0.0.1:8707}" |
| local -r TMPDIR="${SL_TMPDIR:-sltmp}/${NAME}" |
| mkdir -p "${TMPDIR}" |
| trap "kill_child_processes; exit 1" ERR EXIT |
| run_mounttabled "${BLESSNAME}" "${NAME}" "${IPADDR_PORT}" |
| run_measured "${BLESSNAME}" "/${IPADDR_PORT}" "${NAME}" "${TMPDIR}" |
| # Wait for signal. |
| while true; do |
| sleep 10 |
| done |
| } |
| |
| main "$@" |