Commit 14f3dff1 authored by Dillenn Terumalai's avatar Dillenn Terumalai
Browse files

Fixed the .env file creation and uncommented removing remote fake files

parent 4009900e
Pipeline #1258 passed with stage
in 2 minutes and 47 seconds
......@@ -112,7 +112,6 @@ compressFolder() {
transferFile() {
if [ $# -eq 2 ]; then
echo "SUBFOLDER REMOTELY IS: $2";
printf "progress\nput $1" | sftp -b- "${SFTP_URL}$2" || exit 1
else
printf "progress\nput $1" | sftp -b- "${SFTP_URL}" || exit 1
......@@ -418,6 +417,7 @@ generateFakeFiles() {
VIRUSES=viruses
BACTERIA=bacteria
#We generate the fake folders with their fake files
if [ ! -d "$VIRUSES/fake-viruses" ]; then
mkdir -p $VIRUSES/fake-viruses
fi
......@@ -442,17 +442,18 @@ generateFakeFiles() {
autoMode -NA -F
# message="Removing the ${COL_LGREEN}remote fake files${COL_RESET} from SFTP..."
# printf "$message\n"
# echo "rm fake*" | sftp ${SFTP_URL}/viruses || exit 1
# echo "rm fake*" | sftp ${SFTP_URL}/bacteria || exit 1
# echo "Files has been properly removed!"
# message="Removing the ${COL_LGREEN}local fake files${COL_RESET} from SFTP..."
# printf "$message\n"
# cleanup
# echo "Files has been properly removed!"
# exit 0
# We remove remotely the fake files from our SFTP repo to avoid polluting the folders
message="Removing the ${COL_LGREEN}remote fake files${COL_RESET} from SFTP..."
printf "$message\n"
echo "rm fake*" | sftp ${SFTP_URL}/viruses || exit 1
echo "rm fake*" | sftp ${SFTP_URL}/bacteria || exit 1
echo "Files has been properly removed!"
message="Removing the ${COL_LGREEN}fake files${COL_RESET} from SFTP..."
printf "$message\n"
cleanup
echo "Files has been properly removed!"
exit 0
}
# If we pass any arguments...
......@@ -475,7 +476,7 @@ if [ $# -gt 0 ]; then
then
echo "ID=$identifier" > .env
echo 'HOST=spsp-sftp.vital-it.ch' >> .env
echo "SFTP_URL=${ID}@${HOST}:/data" >> .env
echo 'SFTP_URL=${ID}@${HOST}:/data' >> .env
answer=true
else
echo ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment