Skip to content

Instantly share code, notes, and snippets.

@cbowns cbowns/patch.txt Secret

Created Nov 15, 2011
Embed
What would you like to do?
Adds multi-team support to adc_download.sh
diff --git a/adc_download.sh b/adc_download.sh
index 7596bb7..ba88edc 100755
--- a/adc_download.sh
+++ b/adc_download.sh
@@ -7,6 +7,13 @@
# Michael Tyson, A Tasty Pixel <michael@atastypixel.com>
#
+# multi-team support via Christopher Bowns (@cbowns, http://cbowns.com/)
+# fill in with team ID when you view source on <http://developer.apple.com/devcenter/selectTeam.action>. Team names are on the lines below 'select name="memberDisplayId" id="teams"'
+# use formfind at <https://raw.github.com/bagder/curl/master/perl/contrib/formfind> to reveal the form contents if you need help.
+myaccountID="----------"
+teamloginURL="http://developer.apple.com/devcenter/saveTeamSelection.action"
+
+
if [ ! "$1" ]; then
echo "Usage:"
echo " $0 [ADC Download URL]"
@@ -71,6 +78,10 @@ if [ "$newlogin" ]; then
security add-internet-password -U -a "$acct" -s daw.apple.com -w "$pass" -T "$0"
fi
+# submit $myaccountID as teams to the saveTeamSelection url
+# for some reason, adding -i here makes it all work.
+curl -i -s -b /tmp/adccookies.txt -c /tmp/adccookies.txt -F memberDisplayId="$myaccountID" -F "action:saveTeamSelection!save"="Continue" $teamloginURL -o /dev/null
+
echo "Starting download..."
status=`curl -L -O -C - -b /tmp/adccookies.txt "$downloadURL" --write-out '%{http_code}'`
if [ $? != "0" ]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.