corrections

This commit is contained in:
Valentin 2024-11-30 20:44:11 +01:00
parent f15e8d92cd
commit b4ec8839ab
2 changed files with 2 additions and 3 deletions

View File

@ -61,12 +61,12 @@ if [[ "$answer" == "y" ]]; then
echo -e "${PURPLE}${BOLD}Import the .tar.gz archive from your local storage${RESET}" echo -e "${PURPLE}${BOLD}Import the .tar.gz archive from your local storage${RESET}"
echo -e "${PURPLE}The archive should contain the sql dump and the upload directory${RESET}" echo -e "${PURPLE}The archive should contain the sql dump and the upload directory${RESET}"
echo -e "${PURPLE}Make sure the Website Directus user permissions are setup${RESET}" echo -e "${PURPLE}Make sure the Website Directus user permissions are setup${RESET}"
echo -e "${BLUE}scp -P ${SSH_PORT} /local/path/to/archive.tar.gz ${USERNAME}@${IP}:/home/${username}/${RESET}" echo -e "${BLUE}scp -P ${SSH_PORT} /local/path/to/archive.tar.gz ${USERNAME}@${IP}:/home/${USERNAME}/${RESET}"
echo -e "${PURPLE}${BOLD}Press any key when done${RESET}" echo -e "${PURPLE}${BOLD}Press any key when done${RESET}"
read read
directus_archive=$(ls /home/${USERNAME}/*.tar.gz); directus_archive=$(ls /home/${USERNAME}/*.tar.gz);
tar -xzf "${directus_archive}" -C "/home/${USERNAME}/cms.${DOMAIN_NAME}" --strip-components=2 tar -xzf "${directus_archive}" -C "/home/${USERNAME}/cms.${DOMAIN_NAME}" --strip-components=1
rm "${directus_archive}" rm "${directus_archive}"
sql_dump=$(ls /home/${USERNAME}/cms.${DOMAIN_NAME}/*.sql) sql_dump=$(ls /home/${USERNAME}/cms.${DOMAIN_NAME}/*.sql)
docker exec -i "${DOMAIN_NAME}_Directus_DB" mariadb -uroot directus < "${sql_dump}" docker exec -i "${DOMAIN_NAME}_Directus_DB" mariadb -uroot directus < "${sql_dump}"

View File

@ -8,7 +8,6 @@ read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
echo -e "${PURPLE}${BOLD}Enter the desired SSH port (between 1024 and 65535):${RESET}" echo -e "${PURPLE}${BOLD}Enter the desired SSH port (between 1024 and 65535):${RESET}"
read port read port
# @ TODO : is manually setting port really working ?
if [[ "$port" =~ ^[0-9]+$ ]] && [ "$port" -ge 1024 ] && [ "$port" -le 65535 ]; then if [[ "$port" =~ ^[0-9]+$ ]] && [ "$port" -ge 1024 ] && [ "$port" -le 65535 ]; then
SSH_PORT=$port SSH_PORT=$port
else else