mirror of
https://github.com/teddysun/across.git
synced 2025-01-31 12:19:35 +08:00
update comment
This commit is contained in:
parent
78d7889b07
commit
8ea5719756
@ -1,13 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Auto upload file(s) to FTP server
|
# Upload file(s) to FTP server
|
||||||
#
|
#
|
||||||
# Copyright (C) 2016 Teddysun <i@teddysun.com>
|
# Copyright (C) 2016 Teddysun <i@teddysun.com>
|
||||||
#
|
#
|
||||||
# Argument example:
|
# Argument example:
|
||||||
# 1) ./ftp_upload.sh filename
|
# 1) ./ftp_upload.sh filename
|
||||||
# 2) ./ftp_upload.sh filename1 filename2 filename3 ...
|
# 2) ./ftp_upload.sh filename1 filename2 filename3 ...
|
||||||
# 3) ./ftp_upload.sh *.gz
|
# 3) ./ftp_upload.sh *.extension
|
||||||
#
|
#
|
||||||
|
|
||||||
########## START OF CONFIG ##########
|
########## START OF CONFIG ##########
|
||||||
@ -63,7 +63,7 @@ ftp_upload() {
|
|||||||
local FTP_OUT_FILE="$1"
|
local FTP_OUT_FILE="$1"
|
||||||
echo "${FTP_OUT_FILE}" | grep "*" 2>&1 > /dev/null
|
echo "${FTP_OUT_FILE}" | grep "*" 2>&1 > /dev/null
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
ls ${FTP_OUT_FILE} 2>&1 > /dev/null
|
ls ${FTP_OUT_FILE} 2>/dev/null
|
||||||
[ $? -ne 0 ] && log "Error: [${FTP_OUT_FILE}] file(s) not exists!" && exit 1
|
[ $? -ne 0 ] && log "Error: [${FTP_OUT_FILE}] file(s) not exists!" && exit 1
|
||||||
else
|
else
|
||||||
[ ! -f ${FTP_OUT_FILE} ] && log "Error: [${FTP_OUT_FILE}] not exists!" && exit 1
|
[ ! -f ${FTP_OUT_FILE} ] && log "Error: [${FTP_OUT_FILE}] not exists!" && exit 1
|
||||||
@ -87,8 +87,6 @@ STARTTIME=$(date +%s)
|
|||||||
|
|
||||||
[ $# -eq 0 ] && log "Error: argument can not be empty!" && exit 1
|
[ $# -eq 0 ] && log "Error: argument can not be empty!" && exit 1
|
||||||
|
|
||||||
log "Upload progress start"
|
|
||||||
|
|
||||||
check_command
|
check_command
|
||||||
|
|
||||||
for i in $@
|
for i in $@
|
||||||
@ -96,8 +94,6 @@ do
|
|||||||
ftp_upload $i
|
ftp_upload $i
|
||||||
done
|
done
|
||||||
|
|
||||||
log "Upload progress complete"
|
|
||||||
|
|
||||||
ENDTIME=$(date +%s)
|
ENDTIME=$(date +%s)
|
||||||
DURATION=$((ENDTIME - STARTTIME))
|
DURATION=$((ENDTIME - STARTTIME))
|
||||||
log "All done"
|
log "All done"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user