create-lx-container.sh: add git repositors 'admin-stuff' to the new container.

This commit is contained in:
Christoph 2018-04-12 03:27:23 +02:00
parent f7b234f4bd
commit 88a63dea05

View File

@ -1458,6 +1458,78 @@ else
fi
# - Create new container directory '/root/bin'
# -
echo ""
msg="Create a new directory '${LXC_ROOT_DIR}/${LXC_NAME}/rootfs/root/bin' .."
mkdir "${LXC_ROOT_DIR}/${LXC_NAME}/rootfs/root/bin" > $err_msg 2>&1
if [[ $? -eq 0 ]] ; then
msg_ok="New directory '${LXC_ROOT_DIR}/${LXC_NAME}/rootfs/root/bin' created."
length_msg_ok=${#msg_ok}
blank_signs=""
if [[ $length_msg -gt $length_msg_ok ]]; then
number_blank_sign=$(expr $length_msg - $length_msg_ok)
index_i=0
while [[ $index_i -lt $number_blank_sign ]] ; do
blank_signs="$blank_signs "
(( index_i++ ))
done
fi
echo -e "\033[1G [ \033[32m\033[1mok\033[m ] ${msg_ok}${blank_signs}"
else
msg_failed="Failed to create directory '${LXC_ROOT_DIR}/${LXC_NAME}/rootfs/root/bin'!"
length_msg_failed=${#msg_failed}
blank_signs=""
if [[ $length_msg -gt $length_msg_failed ]]; then
number_blank_sign=$(expr $length_msg - $length_msg_failed)
index_i=0
while [[ $index_i -lt $number_blank_sign ]] ; do
blank_signs="$blank_signs "
(( index_i++ ))
done
fi
echo -e "\033[1G [ \033[31m\033[1mfailed\033[m ] ${msg_failed}${blank_signs}"
error "$(cat $err_msg)"
fi
# - Add git repository 'admin-stuff'
# -
msg="Clone git repository 'admin-stuff' to '${LXC_ROOT_DIR}/${LXC_NAME}/rootfs/root/bin/admin-stuff'"
git clone https://git.oopen.de/script/admin-stuff ${LXC_ROOT_DIR}/${LXC_NAME}/rootfs/root/bin/admin-stuff 2> /dev/null
if [[ $? -eq 0 ]] ; then
msg_ok="Git repository '${LXC_ROOT_DIR}/${LXC_NAME}/rootfs/root/bin/admin-stuff' created."
length_msg_ok=${#msg_ok}
blank_signs=""
if [[ $length_msg -gt $length_msg_ok ]]; then
number_blank_sign=$(expr $length_msg - $length_msg_ok)
index_i=0
while [[ $index_i -lt $number_blank_sign ]] ; do
blank_signs="$blank_signs "
(( index_i++ ))
done
fi
echo -e "\033[1G [ \033[32m\033[1mok\033[m ] ${msg_ok}${blank_signs}"
else
msg_failed="Failed to clone git repository 'admin-stuff'!"
length_msg_failed=${#msg_failed}
blank_signs=""
if [[ $length_msg -gt $length_msg_failed ]]; then
number_blank_sign=$(expr $length_msg - $length_msg_failed)
index_i=0
while [[ $index_i -lt $number_blank_sign ]] ; do
blank_signs="$blank_signs "
(( index_i++ ))
done
fi
echo -e "\033[1G [ \033[31m\033[1mfailed\033[m ] ${msg_failed}${blank_signs}"
error "$(cat $err_msg)"
fi
# - Create new containers directory '/root/.ssh'
# -
echo ""