diff --git a/mastblocksdump/mastblocksmerge.sh b/mastblocksdump/mastblocksmerge.sh index 1e14e27..d793337 100755 --- a/mastblocksdump/mastblocksmerge.sh +++ b/mastblocksdump/mastblocksmerge.sh @@ -159,10 +159,10 @@ if [ $INTERACTIVE -eq 1 ]; then [ $? -eq 0 ] && ask=0 done if [ "$inp" == "" ] || [ "$inp" == "s" ] || [ "$inp" == "S" ]; then - buf+="$line" + buf+="$line$IFS" fi done - newblocks="$buf" + newblocks=$(echo "$buf" | head -n -1) fi echo "$newblocks" | PGPASSWORD="$DB_PASS" psql -h "$DB_HOST" -p "$DB_PORT" -d "$DB_NAME" -U "$DB_USER" -A -t -c "COPY domain_blocks ( domain, created_at, updated_at, severity, reject_media, reject_reports, public_comment ) FROM STDIN WITH ( FORMAT text, DELIMITER ' ' )"