2022-09-04 00:29:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if test -f config.sh
|
|
|
|
then
|
|
|
|
. ./config.sh
|
|
|
|
else
|
|
|
|
echo "You are missing config.sh"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2022-09-05 19:06:49 +00:00
|
|
|
. ./libs.sh
|
|
|
|
|
2022-09-04 00:29:38 +00:00
|
|
|
if [ "$(id -u)" -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "you need to be root to run this script"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd hosts
|
2022-09-05 19:06:49 +00:00
|
|
|
|
2022-09-04 00:29:38 +00:00
|
|
|
# load all hosts or the one defined in environment variable NAME
|
|
|
|
if [ -z "$NAME" ]
|
|
|
|
then
|
|
|
|
NAME=*
|
|
|
|
fi
|
|
|
|
|
|
|
|
for i in $NAME
|
|
|
|
do
|
2022-09-05 19:06:49 +00:00
|
|
|
deploy_files "$i"
|
2022-09-06 18:44:04 +00:00
|
|
|
if [ -f ../states.txt ]
|
|
|
|
then
|
|
|
|
cp ../states.txt "${CHROOT_DIR}/states.txt"
|
|
|
|
fi
|
2022-09-04 00:29:38 +00:00
|
|
|
done
|