mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 14:36:58 +02:00
Change-Id: Iaea128d9626ff93ec600d3a2b878885a2efefb28 Review URL: http://codereview.chromium.org/2817049
37 lines
1.1 KiB
Bash
Executable File
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} $*
|