Skip to content

Commit f43e404

Browse files
committed
Do not exit if connection failed
1 parent 297ec61 commit f43e404

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 4.2.4 (2017/11/01)
4+
5+
* Do not exit if connection failed
6+
37
## 4.2.3 (2017/10/30)
48

59
* Fix files download again (Issue #32)

ftpgrab.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
###################################################################################
44
# #
5-
# FTPGrab v4.2.3 #
5+
# FTPGrab v4.2.4 #
66
# #
77
# Simple script to grab your files from a remote FTP server. #
88
# #
@@ -360,7 +360,8 @@ function ftpgrabStart() {
360360
then
361361
ftpgrabEcho "ERROR: Curl error $_CON_EXIT_CODE"
362362
ftpgrabEcho "More infos: https://curl.haxx.se/libcurl/c/libcurl-errors.html"
363-
exit 1
363+
ftpgrabEcho "--------------"
364+
return 1
364365
fi
365366
else
366367
ftpgrabDebug "checkConnection: wget --spider -q --tries=1 --timeout=5 $FTP_WGET -O - "ftp://${FTP_HOST}:${FTP_PORT}${FTP_SRC}""
@@ -370,7 +371,8 @@ function ftpgrabStart() {
370371
then
371372
ftpgrabEcho "ERROR: Wget error $_CON_EXIT_CODE"
372373
ftpgrabEcho "More infos: http://www.gnu.org/software/wget/manual/html_node/Exit-Status.html"
373-
exit 1
374+
ftpgrabEcho "--------------"
375+
return 1
374376
fi
375377
fi
376378

@@ -551,7 +553,7 @@ mkdir -p "$HASH_DIR"
551553
if [ ! -d "$HASH_DIR" ]; then ftpgrabEcho "ERROR: Cannot create dir $HASH_DIR with $(whoami) user"; exit 1; fi
552554
if [ ! -w "$HASH_DIR" ]; then ftpgrabEcho "ERROR: Dir $HASH_DIR is not writable by $(whoami)"; exit 1; fi
553555

554-
ftpgrabEcho "FTPGrab v4.2.3 ($BASENAME_FILE - $(date +"%Y/%m/%d %H:%M:%S"))"
556+
ftpgrabEcho "FTPGrab v4.2.4 ($BASENAME_FILE - $(date +"%Y/%m/%d %H:%M:%S"))"
555557
ftpgrabEcho "--------------"
556558

557559
# Check required packages

0 commit comments

Comments
 (0)