create-lx-container.sh: skip creating directory '.ssh' if it already exists.
This commit is contained in:
parent
968c35b61b
commit
e422efbd30
@ -2568,6 +2568,12 @@ echo -en "\033[1G \033[1;30m[ ... ] \033[32m$msg\033[m"
|
|||||||
if [[ -f "${working_dir}/supported-files/templates_root/.ssh/authorized_keys2" ]] ||
|
if [[ -f "${working_dir}/supported-files/templates_root/.ssh/authorized_keys2" ]] ||
|
||||||
[[ -f "${working_dir}/supported-files/templates_root/.ssh/authorized_keys" ]]; then
|
[[ -f "${working_dir}/supported-files/templates_root/.ssh/authorized_keys" ]]; then
|
||||||
|
|
||||||
|
if [[ -d "${LXC_CONTAINER_DIR}/rootfs/root/.ssh" ]] ; then
|
||||||
|
|
||||||
|
echo -e "\033[1G [ \033[30m\033[1mskip\033[m ] $msg"
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
mkdir "${LXC_CONTAINER_DIR}/rootfs/root/.ssh" > $err_msg 2>&1
|
mkdir "${LXC_CONTAINER_DIR}/rootfs/root/.ssh" > $err_msg 2>&1
|
||||||
|
|
||||||
if [[ $? -eq 0 ]] ; then
|
if [[ $? -eq 0 ]] ; then
|
||||||
@ -2632,6 +2638,7 @@ if [[ -f "${working_dir}/supported-files/templates_root/.ssh/authorized_keys2" ]
|
|||||||
echo -e "\033[1G [ \033[31m\033[1mfailed\033[m ] ${msg_failed}${blank_signs}"
|
echo -e "\033[1G [ \033[31m\033[1mfailed\033[m ] ${msg_failed}${blank_signs}"
|
||||||
error "$(cat $err_msg)"
|
error "$(cat $err_msg)"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo -e "\033[1G [ \033[30m\033[1mskip\033[m ] $msg"
|
echo -e "\033[1G [ \033[30m\033[1mskip\033[m ] $msg"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user