diff --git a/laconia b/laconia index 9665830..47196f8 100755 --- a/laconia +++ b/laconia @@ -19,11 +19,11 @@ usage() { } request(){ - page=$(printf "$host /$path 0\r\n" | nc $host $port) + page=$(printf "$host /$path $post_len\r\n$post" | nc $host $port) status=$(echo $page | awk 'NR == 1 {print $1}') meta=$(echo $page | awk 'NR == 1 {$1=="";print}') if [[ $status == 2 ]]; then - printf "$host /$path $post_len\r\n$post\r\n" | nc $host $port | awk 'NR > 1 {print}' + echo -e "$page\n" | awk 'NR > 1 {print}' elif [[ $status == 3 ]]; then #path=$meta printf "%s %s %s\r\n%s\r\n" "$host" "/$path/" "$post_len" "$post" | nc $host $port | awk 'NR > 1 {print}' @@ -46,8 +46,8 @@ while getopts ":h:p:m:i:u:" arg; do export post_len=$(echo $post | wc -c ) ;; m | --message) - export post=$( echo $OPTARG) - export post_len=$( echo $post | wc -c ) + export post=$OPTARG + export post_len=$(echo $post | wc -c ) ;; u | --url) url_unparsed=$OPTARG diff --git a/message.txt b/message.txt index 9e83a28..5301749 100644 --- a/message.txt +++ b/message.txt @@ -1,2 +1,2 @@ -2.One more test sorry +3.One more test sorry -- g1n