RandomNinjaAtk/arr-scripts

[FEATURE] - Sonarr/Radarr/Prowlarr - Prevent reinstallation on every script run

Closed this issue · 4 comments

Is your feature request related to a problem? Please describe.
When restarting an *arr container, the script spends a lot of time setting up even if a lot of dependencies already exist and are set up.

Describe the solution you'd like
Check for existing setup of configuration / deps and skip what can be skipped when the script is run

Describe alternatives you've considered

  • Manually run the script when needed
  • Check for existing setup in a separate script

Additional context
Add any other context or screenshots about the feature request here.

A temporary solution is to add the script to a custom image here's a lidarr compose file as an example

services:
  lidarr:
    security_opt: ["no-new-privileges:true"]
    image: lscr.io/linuxserver/lidarr:extended
    build:
      dockerfile_inline: |
        FROM lscr.io/linuxserver/lidarr:latest
        RUN curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/setup.bash | bash
    container_name: lidarr
    restart: unless-stopped
    environment:
      PGID: 1000
      PUID: 1000
      TZ: $themoon
    volumes:
      - "./config-lidarr/config/:/config/"
      - "./config-lidarr/services/:/custom-services.d/"
    ports:
      - "8686:8686"
    healthcheck:
      test:
        [
          "CMD",
          "curl",
          "-f",
          "http://eth0.me",
          "&&",
          "curl",
          "-f",
          "http://localhost:8686",
        ]
      interval: 180s
      timeout: 10s
      retries: 3

Keep in mind you'll have to come up with an update solution, like a cron job

cd $lidarrfolder
docker compose up -d --force-recreate --remove-orphans --build

Hmm, it really doesn't take that long for the script to run and process on startup.... Typically less than a minute for me.... But maybe my hardware is more powerful then what your using....

I managed to make it work for sabnzbd, only run one time with the latest changes... I'll see what I can do to implement it in the others.

@insuusvenerati

Changes were implemented to Radarr/Sonarr/Sabnzbd/Lidarr...

Give them a test and report back if everything is resolved....

To test, you will need to restart the container multiple times... First time the script will execute as normal (past behavior). On every restart after that, it should no longer run unless required....