cac-ssh: use json-assert-type

This commit is contained in:
tv 2015-05-21 02:19:23 +02:00
parent 36670f3e1c
commit 8ff3a49978
2 changed files with 17 additions and 1 deletions

16
bin/backtrace Executable file
View File

@ -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

View File

@ -1,7 +1,7 @@
#! /bin/sh
set -euf
server=$1
server=$(json-assert-type object "$1")
shift
address=$(echo $server | jq -r .ip)