cac-ssh: use json-assert-type
This commit is contained in:
parent
36670f3e1c
commit
8ff3a49978
16
bin/backtrace
Executable file
16
bin/backtrace
Executable 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
|
@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
set -euf
|
set -euf
|
||||||
|
|
||||||
server=$1
|
server=$(json-assert-type object "$1")
|
||||||
shift
|
shift
|
||||||
|
|
||||||
address=$(echo $server | jq -r .ip)
|
address=$(echo $server | jq -r .ip)
|
||||||
|
Loading…
Reference in New Issue
Block a user