diff options
author | Jonas Wielicki <j.wielicki@sotecware.net> | 2018-04-20 12:45:52 +0200 |
---|---|---|
committer | Jonas Wielicki <j.wielicki@sotecware.net> | 2018-04-20 12:45:52 +0200 |
commit | b1fa7ddc5f119919429395c7d2f3f746036c936f (patch) | |
tree | b9caa413fc2c430f4bac69207067dd25b558a4ee | |
parent | cd9e2637b8da611d1023e02de5d981de3af8e532 (diff) |
Reformat the huge line of pipes more nicely
-rwxr-xr-x | echoz.sh | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -10,6 +10,18 @@ srv="$( ( dig +short SRV "_xmpp-client._tcp.$domain" || echo "0 0 5222 $domain" host="$(echo "$srv" | cut -d' ' -f4)" port="$(echo "$srv" | cut -d' ' -f3)" authstr="$(echo -ne "\0$username\0$password" | base64)" -rm -f $pipename -mkfifo $pipename -stdbuf -i0 -o0 openssl s_client -starttls xmpp -xmpphost $domain -connect $host:$port -quiet < $pipename | (echo -ne "$jid $authstr\n"; stdbuf -o0 tr '>\n' '\n\001') | stdbuf -o0 "$thisdir/echoz.sed" | stdbuf -o0 tr -d '\n' | stdbuf -o0 tr '\001' '\n' > $pipename +rm -f "$pipename" +mkfifo "$pipename" +stdbuf -i0 -o0 \ + openssl s_client \ + -starttls xmpp \ + -xmpphost "$domain" \ + -connect "$host:$port" \ + -quiet \ + < "$pipename" \ + | (echo -ne "$jid $authstr\n"; \ + stdbuf -o0 tr '>\n' '\n\001') \ + | stdbuf -o0 "$thisdir/echoz.sed" \ + | stdbuf -o0 tr -d '\n' \ + | stdbuf -o0 tr '\001' '\n' \ + > "$pipename" |