#!/bin/bash #set -x mkdir -p temp curl -s -X POST https://api.schwabapi.com/v1/oauth/token \ -H "Authorization: Basic $( temp/accessTokenReqResp.$$.json jq -e -r .access_token temp/accessTokenReqResp.$$.json > access_token.dat if [[ $? -ne 0 ]]; then curl -d "" -X POST "https://deadswitch.kawomi.com/api/v1?topic=trade.schwab.error.getNewAccessToken&secs=1&email=joe@kawomi.com" throw "ERROR: GETTING THE ACCESS TOKEN FAILED! $( temp/refresh_token.dat #if [[ $? -eq 0 ]]; then # mv temp/refresh_token.dat refresh_token.dat #fi ##echo Refresh Token: $(