parent
5029038af5
commit
4063737c8c
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
scriptVersion="1.0.000"
|
||||
|
||||
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
||||
arrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
|
||||
if [ "$arrUrlBase" == "null" ]; then
|
||||
arrUrlBase=""
|
||||
else
|
||||
arrUrlBase="/$(echo "$arrUrlBase" | sed "s/\///g")"
|
||||
fi
|
||||
arrApiKey="$(cat /config/config.xml | xq | jq -r .Config.ApiKey)"
|
||||
arrPort="$(cat /config/config.xml | xq | jq -r .Config.Port)"
|
||||
arrUrl="http://127.0.0.1:${arrPort}${arrUrlBase}"
|
||||
fi
|
||||
|
||||
# auto-clean up log file to reduce space usage
|
||||
if [ -f "/config/logs/Recyclarr.txt" ]; then
|
||||
find /config/logs -type f -name "Recyclarr.txt" -size +1024k -delete
|
||||
fi
|
||||
|
||||
exec &>> "/config/logs/Recyclarr.txt"
|
||||
chmod 666 "/config/logs/Recyclarr.txt"
|
||||
|
||||
log () {
|
||||
m_time=`date "+%F %T"`
|
||||
echo $m_time" :: Recycalarr :: "$1
|
||||
}
|
||||
|
||||
# Configure Yaml with URL and API Key
|
||||
sed -i "s%arrUrl%$arrUrl%g" "/recyclarr.yaml"
|
||||
sed -i "s%arrApi%$arrApiKey%g" "/recyclarr.yaml"
|
||||
|
||||
if [ ! -f /config/extended/configs/recyclarr.yaml ]; then
|
||||
log "Importing default recylarr config file to: /config/extended/configs/recyclarr.yaml"
|
||||
cp "/recyclarr.yaml" "/config/extended/configs/recyclarr.yaml"
|
||||
chmod 766 "/config/extended/configs/recyclarr.yaml"
|
||||
chown abc:abc "/config/extended/configs/recyclarr.yaml"
|
||||
fi
|
||||
|
||||
|
||||
# update radarr
|
||||
log "Updating Sonarr via Recyclarr"
|
||||
/recyclarr/recyclarr sonarr -c /config/extended/configs/recyclarr.yaml --app-data /recyclarr-data
|
||||
log "Complete"
|
||||
|
||||
exit
|
Loading…
Reference in new issue