blob: 3bff03358a7aea8cb30d03de050f9da2c40de2f0 [file] [log] [blame]
#!/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 master device syncbased 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:-client1}"
local -r IPADDR_PORT="${SL_IPADDR_PORT:-127.0.0.1:8909}"
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_syncbased "${BLESSNAME}" "/${IPADDR_PORT}" "syncbased/slcli/${NAME}" "${TMPDIR}"
# Wait for signal.
while true; do
sleep 10
done
}
main "$@"