mirror of
https://github.com/thorsten-gehrig/alexa-remote-control.git
synced 2024-11-14 12:59:02 +01:00
commit
e4697bd1f7
@ -445,7 +445,9 @@ check_status()
|
|||||||
# bootstrap with GUI-Version writes GUI version to cookie
|
# bootstrap with GUI-Version writes GUI version to cookie
|
||||||
# returns among other the current authentication state
|
# returns among other the current authentication state
|
||||||
#
|
#
|
||||||
AUTHSTATUS=$(${CURL} ${OPTS} -s -b ${COOKIE} -A "${BROWSER}" -H "DNT: 1" -H "Connection: keep-alive" -L https://${ALEXA}/api/bootstrap?version=${GUIVERSION} | sed -r 's/^.*"authenticated":([^,]+),.*$/\1/g')
|
AUTHSTATUS=$(${CURL} ${OPTS} -s -b ${COOKIE} -A "${BROWSER}" -H "DNT: 1" -H "Connection: keep-alive" -L https://${ALEXA}/api/bootstrap?version=${GUIVERSION})
|
||||||
|
MEDIAOWNERCUSTOMERID=$(echo $AUTHSTATUS | sed -r 's/^.*"customerId":"([^,]+)",.*$/\1/g')
|
||||||
|
AUTHSTATUS=$(echo $AUTHSTATUS | sed -r 's/^.*"authenticated":([^,]+),.*$/\1/g')
|
||||||
|
|
||||||
if [ "$AUTHSTATUS" = "true" ] ; then
|
if [ "$AUTHSTATUS" = "true" ] ; then
|
||||||
return 1
|
return 1
|
||||||
@ -470,7 +472,10 @@ set_var()
|
|||||||
|
|
||||||
DEVICETYPE=$(jq --arg device "${DEVICE}" -r '.devices[] | select(.accountName == $device) | .deviceType' ${DEVLIST})
|
DEVICETYPE=$(jq --arg device "${DEVICE}" -r '.devices[] | select(.accountName == $device) | .deviceType' ${DEVLIST})
|
||||||
DEVICESERIALNUMBER=$(jq --arg device "${DEVICE}" -r '.devices[] | select(.accountName == $device) | .serialNumber' ${DEVLIST})
|
DEVICESERIALNUMBER=$(jq --arg device "${DEVICE}" -r '.devices[] | select(.accountName == $device) | .serialNumber' ${DEVLIST})
|
||||||
MEDIAOWNERCUSTOMERID=$(jq --arg device "${DEVICE}" -r '.devices[] | select(.accountName == $device) | .deviceOwnerCustomerId' ${DEVLIST})
|
|
||||||
|
# customerId is now retrieved from the logged in user
|
||||||
|
# the customerId in the device list is always from the user registering the device initially
|
||||||
|
# MEDIAOWNERCUSTOMERID=$(jq --arg device "${DEVICE}" -r '.devices[] | select(.accountName == $device) | .deviceOwnerCustomerId' ${DEVLIST})
|
||||||
|
|
||||||
if [ -z "${DEVICESERIALNUMBER}" ] ; then
|
if [ -z "${DEVICESERIALNUMBER}" ] ; then
|
||||||
echo "ERROR: unkown device dev:${DEVICE}"
|
echo "ERROR: unkown device dev:${DEVICE}"
|
||||||
|
@ -396,7 +396,9 @@ check_status()
|
|||||||
# bootstrap with GUI-Version writes GUI version to cookie
|
# bootstrap with GUI-Version writes GUI version to cookie
|
||||||
# returns among other the current authentication state
|
# returns among other the current authentication state
|
||||||
#
|
#
|
||||||
AUTHSTATUS=$(${CURL} ${OPTS} -s -b ${COOKIE} -A "${BROWSER}" -H "DNT: 1" -H "Connection: keep-alive" -L https://${ALEXA}/api/bootstrap?version=${GUIVERSION} | sed -r 's/^.*"authenticated":([^,]+),.*$/\1/g')
|
AUTHSTATUS=$(${CURL} ${OPTS} -s -b ${COOKIE} -A "${BROWSER}" -H "DNT: 1" -H "Connection: keep-alive" -L https://${ALEXA}/api/bootstrap?version=${GUIVERSION})
|
||||||
|
MEDIAOWNERCUSTOMERID=$(echo $AUTHSTATUS | sed -r 's/^.*"customerId":"([^,]+)",.*$/\1/g')
|
||||||
|
AUTHSTATUS=$(echo $AUTHSTATUS | sed -r 's/^.*"authenticated":([^,]+),.*$/\1/g')
|
||||||
|
|
||||||
if [ "$AUTHSTATUS" = "true" ] ; then
|
if [ "$AUTHSTATUS" = "true" ] ; then
|
||||||
return 1
|
return 1
|
||||||
@ -419,8 +421,8 @@ set_var()
|
|||||||
ATTR="serialNumber"
|
ATTR="serialNumber"
|
||||||
SERIAL=`grep ${ATTR}\| ${DEVTXT} | sed "s/^.*${ATTR}|//" | sed 's/ /_/g'`
|
SERIAL=`grep ${ATTR}\| ${DEVTXT} | sed "s/^.*${ATTR}|//" | sed 's/ /_/g'`
|
||||||
|
|
||||||
ATTR="deviceOwnerCustomerId"
|
# ATTR="deviceOwnerCustomerId"
|
||||||
MEDIAID=`grep ${ATTR}\| ${DEVTXT} | sed "s/^.*${ATTR}|//" | sed 's/ /_/g'`
|
# MEDIAID=`grep ${ATTR}\| ${DEVTXT} | sed "s/^.*${ATTR}|//" | sed 's/ /_/g'`
|
||||||
|
|
||||||
ATTR="deviceFamily"
|
ATTR="deviceFamily"
|
||||||
FAMILY=`grep ${ATTR}\| ${DEVTXT} | sed "s/^.*${ATTR}|//" | sed 's/ /_/g'`
|
FAMILY=`grep ${ATTR}\| ${DEVTXT} | sed "s/^.*${ATTR}|//" | sed 's/ /_/g'`
|
||||||
@ -457,14 +459,16 @@ set_var()
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
C=0
|
# customerId is now retrieved from the logged in user
|
||||||
for I in $MEDIAID ; do
|
# the customerId in the device list is always from the user registering the device initially
|
||||||
if [ $C -eq $IDX ] ; then
|
# C=0
|
||||||
MEDIAOWNERCUSTOMERID=$I
|
# for I in $MEDIAID ; do
|
||||||
break
|
# if [ $C -eq $IDX ] ; then
|
||||||
fi
|
# MEDIAOWNERCUSTOMERID=$I
|
||||||
C=$((C+1))
|
# break
|
||||||
done
|
# fi
|
||||||
|
# C=$((C+1))
|
||||||
|
# done
|
||||||
|
|
||||||
C=0
|
C=0
|
||||||
for I in $TYPE ; do
|
for I in $TYPE ; do
|
||||||
|
Loading…
Reference in New Issue
Block a user