summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/bin/partner-cancel.sh')
-rwxr-xr-xplugins/jetpack/bin/partner-cancel.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/jetpack/bin/partner-cancel.sh b/plugins/jetpack/bin/partner-cancel.sh
index f6466415..3931c74f 100755
--- a/plugins/jetpack/bin/partner-cancel.sh
+++ b/plugins/jetpack/bin/partner-cancel.sh
@@ -42,9 +42,13 @@ fi
# fetch an access token using our client ID/secret
ACCESS_TOKEN_JSON=$(curl https://$JETPACK_START_API_HOST/oauth2/token --silent --header "Host: public-api.wordpress.com" -d "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&scope=jetpack-partner")
+# set URL arg for multisite compatibility
+if [ ! -z "$SITE_URL" ]; then
+ ADDITIONAL_ARGS="--url=$SITE_URL"
+fi
+
# silently ensure Jetpack is active
-wp plugin activate jetpack --url="$SITE_URL" >/dev/null 2>&1
+wp plugin activate jetpack $ADDITIONAL_ARGS >/dev/null 2>&1 --allow-root
# cancel the partner plan
-wp jetpack partner_cancel "$ACCESS_TOKEN_JSON" --url="$SITE_URL"
-
+wp jetpack partner_cancel "$ACCESS_TOKEN_JSON" $ADDITIONAL_ARGS --allow-root