flatcar-scripts/start_devserver
2010-07-02 13:53:17 -07:00

37 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Start the Dev Server after making sure we are running under a chroot.
. "$(dirname "$0")/common.sh"
# Script must be run inside the chroot if not in 'always serve' mode.
if [[ "$1" != "--archive_dir" ]]
then
restart_in_chroot_if_needed $*
fi
# Temporary workaround to support requests from update_engine daemon
DEFINE_boolean update_engine $FLAGS_FALSE \
"Start devserver to handle update_engine requests. Default: False"
# Parse command line.
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"
set -e
CLIENT_PREFIX=
if [ "${FLAGS_update_engine}" -eq "${FLAGS_TRUE}" ] ; then
echo "!!! devserver will only handle request from update_engine"
# --client_prefix flag is defined in devserver.py
CLIENT_PREFIX="--client_prefix ChromeOSUpdateEngine"
else
echo "!!! devserver will only handle request from memento_updater"
fi
cd ${GCLIENT_ROOT}/src/platform/dev && python devserver.py ${CLIENT_PREFIX} $*