Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SPSP
Transfer Tool
Commits
a515c369
Commit
a515c369
authored
Dec 20, 2019
by
Dillenn Terumalai
Browse files
Fixed some issues regarding connectivity
parent
70fe582f
Changes
2
Hide whitespace changes
Inline
Side-by-side
.env
View file @
a515c369
ID=labo1
SFTP_URL=${ID}@spsp-sftp.vital-it.ch:/data
\ No newline at end of file
HOST=spsp-sftp.vital-it.ch
SFTP_URL=${ID}@${HOST}:/data
\ No newline at end of file
spsp
View file @
a515c369
...
...
@@ -210,10 +210,17 @@ if [ $# -gt 0 ]; then
fi
LOGFILE
=
"./logs/spsp-
$CURRENTDATE
.log"
if
[
!
-f
$LOGFILE
]
;
then
touch
$LOGFILE
fi
echo
""
if
!
nc
-w
1
-z
${
HOST
}
22 &> /dev/null
;
then
echo
"[
`
date
+
"%T"
`
] local.ERROR:
${
HOST
}
:22 is unreachable, please check your connection"
>>
$LOGFILE
echo
"SPSP: Error detected please check
$LOGFILE
"
exit
0
fi
for
DIRECTORY
in
*
;
do
if
[
-d
"
$DIRECTORY
"
]
&&
[
$DIRECTORY
!=
$OUTBOX
]
&&
[
$DIRECTORY
!=
$SENT
]
&&
[
$DIRECTORY
!=
$LOGS
]
;
then
if
ls
$DIRECTORY
/
*
.fastq
*
1> /dev/null 2>&1
&&
[
-f
$DIRECTORY
/
*
.xlsx
]
;
then
...
...
@@ -224,13 +231,13 @@ if [ $# -gt 0 ]; then
rm
-rf
$DIRECTORY
mv
$DIRECTORY
.tar.gz ./outbox/.
else
echo
"[
`
date
+
"%T"
`
] local.ERROR: Missing files (*.fastq
or *.xlsx) inside
${
DIRECTORY
}
"
>>
$LOGFILE
echo
"[
`
date
+
"%T"
`
] local.ERROR: Missing files (*.fastq
/.fastq.gz and/
or *.xlsx) inside
${
DIRECTORY
}
"
>>
$LOGFILE
echo
"SPSP: Error detected please check
$LOGFILE
"
exit
0
fi
fi
done
echo
""
for
FILE
in
./outbox/
*
;
do
if
[
-f
"
$FILE
"
]
;
then
echo
"SPSP: Signing
$FILE
using SHA-256 algorithm..."
...
...
@@ -255,10 +262,6 @@ if [ $# -gt 0 ]; then
exit
0
fi
echo
""
else
echo
"[
`
date
+
"%T"
`
] local.ERROR: No file found inside output directory"
>>
$LOGFILE
echo
"SPSP: Error detected please check
$LOGFILE
"
exit
0
fi
done
echo
""
...
...
@@ -282,7 +285,7 @@ if [ $# -gt 0 ]; then
encryptFile
$@
else
message
=
"Command does not exist, please check the help
\n
${
COL_LGREEN
}
/script.sh help
${
COL_RESET
}
"
message
=
"Command does not exist, please check the help
\n
${
COL_LGREEN
}
.
/script.sh help
${
COL_RESET
}
"
printf
"
$message
\n
"
fi
fi
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment