]>
Commit | Line | Data |
---|---|---|
fe8ab488 A |
1 | #!/bin/sh |
2 | ||
3 | TMPFILE=$(mktemp /var/tmp/iosspeedtracer-$$-XXXXXX) | |
4 | TMPFILE2=$(mktemp /var/tmp/iosspeedtracer2-$$-XXXXXX) | |
5 | trap 'rm -f $TMPFILE $TMPFILE2' 0 | |
6 | ||
7 | # save stack log for curl | |
8 | cat > $TMPFILE | |
9 | ||
10 | if 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 | |
18 | else | |
19 | echo "no internet password keychain item for ios.apple.com?!" | |
20 | fi |