v1.5 - User port instead of app name

#17
This commit is contained in:
RandomNinjaAtk 2023-07-14 19:12:34 -04:00 committed by GitHub
parent 2c93170ab2
commit fb7d2a2b08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
scriptVersion="1.4" scriptVersion="1.5"
scriptName="Recyclarr" scriptName="Recyclarr"
log () { log () {
@ -47,22 +47,21 @@ getArrAppInfo () {
arrPort="$(cat /config/config.xml | xq | jq -r .Config.Port)" arrPort="$(cat /config/config.xml | xq | jq -r .Config.Port)"
arrUrl="http://127.0.0.1:${arrPort}${arrUrlBase}" arrUrl="http://127.0.0.1:${arrPort}${arrUrlBase}"
fi fi
if [ "$arrName" == "Radarr" ]; then if [ "$arrPort" == "7878" ]; then
recylcarrApp="radarr" recylcarrApp="radarr"
fi fi
if [ "$arrName" == "Sonarr" ]; then if [ "$arrPort" == "8989" ]; then
recylcarrApp="sonarr" recylcarrApp="sonarr"
fi fi
} }
verifyApiAccess () { verifyApiAccess () {
until false until false
do do
arrApiTest="" arrApiTest=""
arrApiVersion="" arrApiVersion=""
if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ]; then if [ "$arrPort" == "8989" ] || [ "$arrPort" == "7878" ]; then
arrApiVersion="v3" arrApiVersion="v3"
elif [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then elif [ "$arrPort" == "8686" ] || [ "$arrPort" == "8787" ]; then
arrApiVersion="v1" arrApiVersion="v1"
fi fi
arrApiTest=$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .instanceName) arrApiTest=$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .instanceName)
@ -74,6 +73,7 @@ verifyApiAccess () {
fi fi
done done
} }
RecyclarrProcess () { RecyclarrProcess () {
# Configure Yaml with URL and API Key # Configure Yaml with URL and API Key
sed -i "s%arrUrl%$arrUrl%g" "/config/extended/recyclarr.yaml" sed -i "s%arrUrl%$arrUrl%g" "/config/extended/recyclarr.yaml"