2023-09-01 00:44:57 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: updateip
|
|
|
|
namespace: download
|
|
|
|
data:
|
|
|
|
updateip.sh: |
|
|
|
|
#!/bin/bash
|
|
|
|
echo 'getting pod name'
|
|
|
|
POD_NAME=$(kubectl get pods -n download --selector "app.kubernetes.io/name=qbittorrent" --output=jsonpath={.items..metadata.name})
|
|
|
|
echo $POD_NAME
|
2023-09-01 00:51:36 +00:00
|
|
|
OUTPUT=$(kubectl exec -it $POD_NAME -n download -- /bin/bash -c 'MAM_ID=$(cat /etc/tokens/mam-id); curl -i -c /etc/mam.cookies -b "mam_id=$MAM_ID" https://t.myanonamouse.net/json/dynamicSeedbox.php')
|
2023-09-01 00:44:57 +00:00
|
|
|
echo $OUTPUT
|
|
|
|
if [[ $OUTPUT == *"Success\":true"* ]]; then
|
|
|
|
echo "Success"
|
|
|
|
else
|
|
|
|
echo "Failure"
|
|
|
|
exit 1
|
|
|
|
fi
|