document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/bash
  2.  
  3. applicationId="9nwGgQXXXXXXXXXXX"
  4. secretkey="lsqxavsJrdMcXOIXXXXXXXXXXXXX"
  5. LATCH="/etc/latch.accounts"
  6. account=`grep "^$USER:" $LATCH |cut -d: -f2`
  7. if [ -z `echo "$account"|cut -d: -f2`  ]; then exit 0; fi
  8.  
  9. URL="/api/0.6/status/$account"
  10. requestSignature+="GET\\n"
  11. date=`date -u \'+%Y-%m-%d %H:%M:%S\'`
  12. requestSignature+="$date\\n\\n$URL"
  13. signed=`echo -en "$requestSignature" | openssl dgst -sha1 -hmac "$secretkey" -binary|sed -e \'s|.*= \\(.*\\)|\\
  14. 1|g\'`
  15. b64signed=`echo -n "$signed"|base64`
  16. auth_header="Authorization: 11PATHS $applicationId $b64signed"
  17. date_header="X-11Paths-Date: $date"
  18.  
  19. JSON=`wget -q --no-check-certificate -O - --header "$auth_header" --header "$date_header" "https://latch.el
  20. evenpaths.com$URL"`
  21. status=`echo -e "$JSON" | sed -e \'s|.*status":"\\(.*\\)","name.*|\\1|g\'`
  22.  
  23. if [ "$status" == "off" ]; then
  24.    echo -e "200Latch is off. Change it in your phone\\n"
  25.    sleep 999999
  26. elif [ "$status" == "on" ]; then
  27.    exit 0
  28. else
  29.    echo -e "200Latch error. Try again\\n"
  30.    sleep 999999
  31. fi
');