blob: 2d674928e791205ecb17fe0725ff1c05cbd3db72 [file] [log] [blame]
# Copyright 2015 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.
description "Ensure adb home directory exists."
author ""
start on starting boot-services
# In case stateful is wiped, recreate the moblab home directory and ensure
# moblab owns it.
mkdir -p "${ADB_HOME}"
chown adb:adb "${ADB_HOME}"
# Copy over the ssh keys if they don't already exist.
if [ ! -e "${ADB_SSH_DIR}"/id_rsa ]; then
mkdir -p "${ADB_SSH_DIR}"
cp /root/.ssh/* "${ADB_SSH_DIR}"
chown -R adb:adb "${ADB_SSH_DIR}"
# Ensure the adb server is up and running as root.
adb start-server
end script