1
0
mirror of https://github.com/rancher/os.git synced 2025-05-14 19:09:26 +00:00
os/scripts/installer/seed-data

24 lines
508 B
Plaintext
Raw Normal View History

#!/bin/bash
set -e -x
BASE_DIR=${1}
CLOUD_DATA=${2}
IFS=',' read -ra FILES <<< "${3}"
if [ -z ${BASE_DIR} ]; then
echo "Need base directory to place files" 1>&2
exit 1
fi
2015-08-18 07:39:43 +00:00
mkdir -p ${BASE_DIR}/var/lib/rancher/conf/cloud-config.d
2015-08-18 14:07:00 +00:00
if [ "$CLOUD_DATA" != "/scripts/conf/empty.yml" ]; then
cp ${CLOUD_DATA} ${BASE_DIR}/var/lib/rancher/conf/cloud-config.d/
fi
for f in ${FILES[@]}; do
IFS=":" read s d <<< "${f}"
mkdir -p $(dirname ${BASE_DIR}/${d})
cp -a -T ${s} ${BASE_DIR}/${d}
done