-
-
Save cbowns/66e72a517408d962d999 to your computer and use it in GitHub Desktop.
Adds multi-team support to adc_download.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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