Skip to content

Instantly share code, notes, and snippets.

@cbowns

cbowns/patch.txt Secret

Created November 15, 2011 23:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbowns/66e72a517408d962d999 to your computer and use it in GitHub Desktop.
Save cbowns/66e72a517408d962d999 to your computer and use it in GitHub Desktop.
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