Skip to content

Commit c63072c

Browse files
committed
Remove progress filter on wget
1 parent 79abdcf commit c63072c

3 files changed

Lines changed: 3 additions & 46 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Before running the script, you must change some vars in the config file ``ftp-sy
3939
* **DL_REGEX** - Apply a filter to search for files with a regular expression. Separate each regular expression with a semicolon. Leave empty to grab all files. Optional. For example: `Game.Of.Thrones.*.avi;Burn.Notice.*.avi;The.Big.Bang.Theory.*VOSTFR.*720p.*WEB-DL.*.mkv`
4040
* **DL_RETRY** - Number of retries in case of failure of download. (default 3)
4141
* **DL_HIDE_SKIPPED** - Not display the downloads already made ​​or valid in logs. (default 0)
42-
* **DL_HIDE_PROGRESS** - Not display the progress dots during downloads. Can sometimes prevent downloading, see [Issue #3](https://github.com/crazy-max/ftp-sync/issues/3). (default 1)
4342
* **MD5_ENABLED** - Enable audit file already downloaded.
4443
* **MD5_FILE** - The audit file containing the hash of each downloaded file (default /etc/ftp-sync/ftp-sync.md5).
4544
* **DIR_LOGS** - Path to save ftp-sync logs. (default /etc/ftp-sync/logs)

ftp-sync.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ DL_CHMOD=""
1515
DL_REGEX=""
1616
DL_RETRY=3
1717
DL_HIDE_SKIPPED=0
18-
DL_HIDE_PROGRESS=1
1918

2019
# MD5
2120
MD5_ENABLED=1

ftp-sync.sh

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
##################################################################################
1212
# #
13-
# FTP Sync v1.8 #
13+
# FTP Sync v1.9 #
1414
# #
1515
# A shell script to synchronize files between a remote FTP server and #
1616
# your local server/computer. #
@@ -84,16 +84,6 @@ function ftpsyncIsDownloaded() {
8484
echo "0"
8585
}
8686

87-
function ftpsyncIsMd5Enabled() {
88-
if [ -z "$1" ]; then local skipmd5=0; else local skipmd5=1; fi
89-
if [ "$MD5_ENABLED" == "1" -a -f "$MD5_FILE" -a "$skipmd5" == "0" ]
90-
then
91-
echo "1"
92-
exit 1;
93-
fi
94-
echo "0"
95-
}
96-
9787
function ftpsyncDownloadFile() {
9888
local srcfile="$1"
9989
local srcfiledec=$(ftpsyncUrlDecode "$srcfile")
@@ -115,7 +105,7 @@ function ftpsyncDownloadFile() {
115105

116106
# Begin download
117107
if [ -z "$LOG" ]; then ftpsyncEcho "Start download to $destfile... Please wait..."; fi
118-
wget --progress=dot:mega --ftp-user="$FTP_USER" --ftp-password="$FTP_PASSWORD" -O "$destfile" "ftp://$FTP_HOST:$FTP_PORT$srcfile" 2>&1 | ftpsyncProgressFilter
108+
wget --progress=dot:mega --ftp-user="$FTP_USER" --ftp-password="$FTP_PASSWORD" -O "$destfile" "ftp://$FTP_HOST:$FTP_PORT$srcfile" >/dev/null 2>&1
119109

120110
local errordl="$?"
121111
local dlstatus=`ftpsyncIsDownloaded "$srcfile" "1"`
@@ -222,37 +212,6 @@ function ftpsyncProcess() {
222212
done
223213
}
224214

225-
function ftpsyncProgressFilter() {
226-
if [ "$DL_HIDE_PROGRESS" == "0" ]
227-
then
228-
local flag=2 c count cr=$'\r' nl=$'\n'
229-
while IFS='' read -d '' -rn 1 c
230-
do
231-
if [ $flag == 1 ]
232-
then
233-
printf '%c' "$c"
234-
if [[ "$c" =~ (s$) ]]
235-
then
236-
flag=0
237-
echo ""
238-
fi
239-
elif [ $flag != 0 ]
240-
then
241-
if [[ $c != $cr && $c != $nl ]]
242-
then
243-
count=0
244-
else
245-
((count++))
246-
if ((count > 1))
247-
then
248-
flag=1
249-
fi
250-
fi
251-
fi
252-
done
253-
fi
254-
}
255-
256215
function ftpsyncKill() {
257216
local cpid="$1"
258217
pids="$cpid"
@@ -350,7 +309,7 @@ if [ ! -d "$DIR_LOGS" ]; then mkdir -p "$DIR_LOGS"; fi
350309
LOG_FILE="$DIR_LOGS/ftp-sync-`date +%Y%m%d%H%M%S`.log"
351310
touch "$LOG_FILE"
352311

353-
ftpsyncEcho "FTP Sync v1.8 (`date +"%Y/%m/%d %H:%M:%S"`)"
312+
ftpsyncEcho "FTP Sync v1.9 (`date +"%Y/%m/%d %H:%M:%S"`)"
354313
ftpsyncEcho "--------------"
355314

356315
# Check required packages

0 commit comments

Comments
 (0)