главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Wielicki <j.wielicki@sotecware.net>2018-04-20 12:45:52 +0200
committerJonas Wielicki <j.wielicki@sotecware.net>2018-04-20 12:45:52 +0200
commitb1fa7ddc5f119919429395c7d2f3f746036c936f (patch)
treeb9caa413fc2c430f4bac69207067dd25b558a4ee
parentcd9e2637b8da611d1023e02de5d981de3af8e532 (diff)
Reformat the huge line of pipes more nicely
-rwxr-xr-xechoz.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/echoz.sh b/echoz.sh
index 643c45e..b6c14f2 100755
--- a/echoz.sh
+++ b/echoz.sh
@@ -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"