From 8ff3a49978d9b802b1c7ce401fc682a33452d633 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 21 May 2015 02:19:23 +0200 Subject: cac-ssh: use json-assert-type --- bin/backtrace | 16 ++++++++++++++++ bin/cac-ssh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 bin/backtrace diff --git a/bin/backtrace b/bin/backtrace new file mode 100755 index 000000000..f8582ec2f --- /dev/null +++ b/bin/backtrace @@ -0,0 +1,16 @@ +#! /bin/sh +set -euf + +pid=$$ +while :; do + cd /proc/$pid + cmdline=$(cat cmdline | sed 's/\0/ /g;s/ $//') + ppid=$(grep PPid status | awk '{print$2}') + printf '%5d %s\n' $pid "$cmdline" + if [ $pid = 1 ]; then + break + else + pid=$ppid + fi +done \ + | tac diff --git a/bin/cac-ssh b/bin/cac-ssh index a0ec5dcf3..e01f76b10 100755 --- a/bin/cac-ssh +++ b/bin/cac-ssh @@ -1,7 +1,7 @@ #! /bin/sh set -euf -server=$1 +server=$(json-assert-type object "$1") shift address=$(echo $server | jq -r .ip) -- cgit v1.2.3