File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
2323
2424# Defining ftp command function
2525ftpc () {
26- /usr/bin/ ftp -n $host $ftp_port << EOF
26+ ftp -n $host $ftp_port << EOF
2727 quote USER $ftp_user
2828 quote PASS $ftp_password
2929 binary
@@ -48,7 +48,8 @@ validate_format 'host' 'ftp_user' 'ftp_password'
4848# ----------------------------------------------------------#
4949
5050# Checking network connection
51- if [ ! -z " $( ftpc) " ]; then
51+ ftp_connect=$( ftpc)
52+ if [ ! -z " $( echo $ftp_connect | grep -i -e error -e ' not connected' ) " ]; then
5253 echo " Error: can't login to ftp"
5354 log_event " $E_CONNECT " " $EVENT "
5455 exit $E_CONNECT
@@ -60,7 +61,7 @@ ftmpdir=$(mktemp -u -p "$ftp_path")
6061ftp_result=$( ftpc " mkdir $ftmpdir " " rm $ftmpdir " )
6162if [ ! -z " $ftp_result " ] ; then
6263 rm -rf $tmpdir
63- echo " Error: can't create temp folder on the ftp"
64+ # echo "Error: can't create temp folder on the ftp"
6465 log_event " $E_FTP " " $EVENT "
6566 exit $E_FTP
6667fi
Original file line number Diff line number Diff line change @@ -556,7 +556,8 @@ ftp_backup() {
556556 echo -e " $( date " +%F %T" ) FTP ftp://$HOST$BPATH /$user .$DATE .tar"
557557
558558 # Checking ftp connection
559- if [ ! -z " $( ftpc) " ]; then
559+ ftp_connect=$( ftpc)
560+ if [ ! -z " $( echo $ftp_connect | grep -i -e error -e ' not conn' ) " ]; then
560561 rm -rf $tmpdir
561562 echo " Can't login to ftp://$USERNAME @$HOST " | \
562563 $send_mail -s " $subj " $email
You can’t perform that action at this time.
0 commit comments