]> git.saurik.com Git - apple/xnu.git/blame - tools/lldbmacros/plugins/iosspeedtracer.sh
xnu-2782.1.97.tar.gz
[apple/xnu.git] / tools / lldbmacros / plugins / iosspeedtracer.sh
CommitLineData
fe8ab488
A
1#!/bin/sh
2
3TMPFILE=$(mktemp /var/tmp/iosspeedtracer-$$-XXXXXX)
4TMPFILE2=$(mktemp /var/tmp/iosspeedtracer2-$$-XXXXXX)
5trap 'rm -f $TMPFILE $TMPFILE2' 0
6
7# save stack log for curl
8cat > $TMPFILE
9
10if security find-internet-password -s ios.apple.com > $TMPFILE2; then
11 USER=$(sed -n -E -e 's/"acct"<blob>="([^"]*)"/\1/p' < $TMPFILE2)
12 PW=$(security find-internet-password -a $USER -s ios.apple.com -w)
13 if [[ $? = 0 ]]; then
14 curl -u $USER:$PW -X POST -H "Content-Type: text/plain" -H "Accept: text/plain" --data-binary @${TMPFILE} https://ios.apple.com/speedtracer/services/logs
15 else
16 echo "security failed -- try security unlock-keychain"
17 fi
18else
19 echo "no internet password keychain item for ios.apple.com?!"
20fi