changed to a url
This commit is contained in:
parent
8b73888082
commit
1a2bb566c1
24
.drone.yml
24
.drone.yml
@ -39,21 +39,15 @@ steps:
|
|||||||
from_secret: PHC_HEALTHCHECK_URL
|
from_secret: PHC_HEALTHCHECK_URL
|
||||||
PHC_HEALTHCHECK_ID:
|
PHC_HEALTHCHECK_ID:
|
||||||
from_secret: PHC_HEALTHCHECK_ID
|
from_secret: PHC_HEALTHCHECK_ID
|
||||||
PHC_PLEX_HOST:
|
PHC_PLEX_URL:
|
||||||
from_secret: PHC_PLEX_HOST
|
from_secret: PHC_PLEX_URL
|
||||||
PHC_PLEX_PROTOCOL:
|
|
||||||
from_secret: PHC_PLEX_PROTOCOL
|
|
||||||
PHC_PLEX_PORT:
|
|
||||||
from_secret: PHC_PLEX_PORT
|
|
||||||
CRON:
|
CRON:
|
||||||
from_secret: CRON
|
from_secret: CRON
|
||||||
commands:
|
commands:
|
||||||
- echo $PHC_PLEX_SECRET_TOKEN
|
- echo $PHC_PLEX_SECRET_TOKEN
|
||||||
- echo $PHC_HEALTHCHECK_URL
|
- echo $PHC_HEALTHCHECK_URL
|
||||||
- echo $PHC_HEALTHCHECK_ID
|
- echo $PHC_HEALTHCHECK_ID
|
||||||
- echo $PHC_PLEX_HOST
|
- echo $PHC_PLEX_URL
|
||||||
- echo $PHC_PLEX_PROTOCOL
|
|
||||||
- echo $PHC_PLEX_PORT
|
|
||||||
- echo $CRON
|
- echo $CRON
|
||||||
- /bin/sh /opt/phc.sh
|
- /bin/sh /opt/phc.sh
|
||||||
when:
|
when:
|
||||||
@ -68,21 +62,15 @@ steps:
|
|||||||
from_secret: PHC_HEALTHCHECK_URL
|
from_secret: PHC_HEALTHCHECK_URL
|
||||||
PHC_HEALTHCHECK_ID:
|
PHC_HEALTHCHECK_ID:
|
||||||
from_secret: PHC_HEALTHCHECK_ID
|
from_secret: PHC_HEALTHCHECK_ID
|
||||||
PHC_PLEX_HOST:
|
PHC_PLEX_URL:
|
||||||
from_secret: PHC_PLEX_HOST
|
from_secret: PHC_PLEX_URL
|
||||||
PHC_PLEX_PROTOCOL:
|
|
||||||
from_secret: PHC_PLEX_PROTOCOL
|
|
||||||
PHC_PLEX_PORT:
|
|
||||||
from_secret: PHC_PLEX_PORT
|
|
||||||
CRON:
|
CRON:
|
||||||
from_secret: CRON
|
from_secret: CRON
|
||||||
commands:
|
commands:
|
||||||
- echo $PHC_PLEX_SECRET_TOKEN
|
- echo $PHC_PLEX_SECRET_TOKEN
|
||||||
- echo $PHC_HEALTHCHECK_URL
|
- echo $PHC_HEALTHCHECK_URL
|
||||||
- echo $PHC_HEALTHCHECK_ID
|
- echo $PHC_HEALTHCHECK_ID
|
||||||
- echo $PHC_PLEX_HOST
|
- echo $PHC_PLEX_URL
|
||||||
- echo $PHC_PLEX_PROTOCOL
|
|
||||||
- echo $PHC_PLEX_PORT
|
|
||||||
- echo $CRON
|
- echo $CRON
|
||||||
- /bin/sh /opt/phc.sh
|
- /bin/sh /opt/phc.sh
|
||||||
when:
|
when:
|
||||||
|
6
phc.sh
6
phc.sh
@ -1,11 +1,9 @@
|
|||||||
: "${PHC_PLEX_SECRET_TOKEN:?Must set PHC_SECRET_TOKEN env variable}"
|
: "${PHC_PLEX_SECRET_TOKEN:?Must set PHC_SECRET_TOKEN env variable}"
|
||||||
: "${PHC_HEALTHCHECK_URL:?Must set PHC_HEALTHCHECK_URL env variable}"
|
: "${PHC_HEALTHCHECK_URL:?Must set PHC_HEALTHCHECK_URL env variable}"
|
||||||
: "${PHC_HEALTHCHECK_ID:?Must set PHC_HEALTHCHECK_ID env variable}"
|
: "${PHC_HEALTHCHECK_ID:?Must set PHC_HEALTHCHECK_ID env variable}"
|
||||||
: "${PHC_PLEX_HOST:?Must set PHC_PLEX_HOST env variable}"
|
: "${PHC_PLEX_URL:?Must set PHC_PLEX_URL env variable}"
|
||||||
: "${PHC_PLEX_PORT:-32400}"
|
|
||||||
: "${PHC_PLEX_PROTOCOL:-"http"}"
|
|
||||||
|
|
||||||
URL="${PHC_PLEX_PROTOCOL}://${PHC_PLEX_HOST}:${PHC_PLEX_PORT}/connections?X-Plex-Token=${PHC_PLEX_SECRET_TOKEN}"
|
URL="${PHC_PLEX_URL}/connections?X-Plex-Token=${PHC_PLEX_SECRET_TOKEN}"
|
||||||
|
|
||||||
ping_hc() {
|
ping_hc() {
|
||||||
curl -fsS -m 10 --retry 5 -o /dev/null --data-raw "$2" "${PHC_HEALTHCHECK_URL}/ping/${PHC_HEALTHCHECK_ID}/$1"
|
curl -fsS -m 10 --retry 5 -o /dev/null --data-raw "$2" "${PHC_HEALTHCHECK_URL}/ping/${PHC_HEALTHCHECK_ID}/$1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user