mkdumprd: remove some redundant echo

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Philipp Rudo <prudo@redhat.com>
This commit is contained in:
Kairui Song 2021-08-04 03:53:35 +08:00
parent 227fc2bc7d
commit e4c7b5bbf5

View File

@ -94,7 +94,7 @@ to_mount() {
#$1=dump target #$1=dump target
#called from while loop and shouldn't read from stdin, so we're using "ssh -n" #called from while loop and shouldn't read from stdin, so we're using "ssh -n"
get_ssh_size() { get_ssh_size() {
local _opt _out _size local _opt _out
_opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes" _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
_out=$(ssh -q -n $_opt $1 "df -P $SAVE_PATH") _out=$(ssh -q -n $_opt $1 "df -P $SAVE_PATH")
[ $? -ne 0 ] && { [ $? -ne 0 ] && {
@ -102,8 +102,7 @@ get_ssh_size() {
} }
#ssh output removed the line break, so print field NF-2 #ssh output removed the line break, so print field NF-2
_size=$(echo -n $_out| awk '{avail=NF-2; print $avail}') echo -n "$_out" | awk '{avail=NF-2; print $avail}'
echo -n $_size
} }
#mkdir if save path does not exist on ssh dump target #mkdir if save path does not exist on ssh dump target
@ -134,14 +133,13 @@ mkdir_save_path_ssh()
#Function: get_fs_size #Function: get_fs_size
#$1=dump target #$1=dump target
get_fs_size() { get_fs_size() {
local _mnt=$(get_mntpoint_from_target $1) df -P "$(get_mntpoint_from_target "$1")/$SAVE_PATH"|tail -1|awk '{print $4}'
echo -n $(df -P "${_mnt}/$SAVE_PATH"|tail -1|awk '{print $4}')
} }
#Function: get_raw_size #Function: get_raw_size
#$1=dump target #$1=dump target
get_raw_size() { get_raw_size() {
echo -n $(fdisk -s "$1") fdisk -s "$1"
} }
#Function: check_size #Function: check_size