Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
environment: add ssh port
Browse files Browse the repository at this point in the history
  • Loading branch information
AlxisHenry committed Dec 16, 2022
1 parent c45f2d7 commit 7e6d3f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cdn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ dir=$(dirname $0)
files=$(ls -1 uploads)

function uploads() {
ssh ${SSH_USER}@${SSH_ADDR} "sudo chown -R ${SSH_USER}:${SSH_USER} ${SSH_DIST}/${category}";
rsync -azP -e 'ssh' ${dir}/uploads/${filenameFormatted} ${SSH_USER}@${SSH_ADDR}:${SSH_DIST}/${category}/;
ssh ${SSH_USER}@${SSH_ADDR} "sudo chown -R www-data:www-data ${SSH_DIST}/${category}";
ssh ${SSH_USER}@${SSH_ADDR} -p ${SSH_PORT} "sudo chown -R ${SSH_USER}:${SSH_USER} ${SSH_DIST}/${category}";
rsync -azP -e "ssh -p ${SSH_PORT}" ${dir}/uploads/${filenameFormatted} ${SSH_USER}@${SSH_ADDR}:${SSH_DIST}/${category}/;
ssh ${SSH_USER}@${SSH_ADDR} -p ${SSH_PORT} "sudo chown -R www-data:www-data ${SSH_DIST}/${category}";
}

file_extension="pdf md txt"
Expand Down Expand Up @@ -41,8 +41,8 @@ do
category="videos"
fi
done
mv ${dir}/uploads/${file} ${dir}/uploads/${filenameFormatted}
uploads ${filenameFormatted} ${category};
mv ${dir}/uploads/${file} ${dir}/uploads/${filenameFormatted} > /dev/null 2>&1;
uploads ${filenameFormatted} ${category} > /dev/null 2>&1;
echo -e "Le fichier ${filenameColored} a été envoyé :";
echo -e " - Lien vers le cdn: \033[32m${CDN_URL}/public/${category}?file=${filenameFormatted}\033[0m";
echo -e " - Lien vers le fichier: \033[32m${CDN_URL}/public/${category}/${filenameFormatted}\033[0m"
Expand Down

0 comments on commit 7e6d3f7

Please sign in to comment.