blob: 50b5c057b658ef876dd6fff112c6a1e7bbaee561 [file] [log] [blame]
# Copyright 2021 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.
# TODO (prasadv): Make a generic upscript for moblab and satlab
description "Safely stop all the docker conatiners."
author ""
start on starting pre-shutdown
mkdir -p /var/log/bootup/
exec >>/var/log/bootup/${UPSTART_JOB}.log 2>&1
set -x
set +e
APP_KEY="$(vpd -i RW_VPD -g application)"
if [ "$?" != "0" ] || [ "${APP_KEY}" != "satlab" ]; then
echo "Cannot start ${UPSTART_JOB} for APP_KEY = ${APP_KEY}."
exit 1
set -e
docker exec -i compose / down
docker stop compose
docker stop dhcp
end script