Servarr/Wiki

*arrs installation script - unexpected output

Closed this issue · 4 comments

First of all thank you and the community so much for the offered install scripts for each *arr, much better than the way I was doing it before!

https://wiki.servarr.com/readarr/installation

When using the community contributed scripts to install I get unexpected output relating to members of the install group.

running getent group $app_guid | grep "\b${app_uid}\b" on my system shows:

media:x:1001:radarr,lidarr,readarr,prowlarr,debian-transmission

so readarr is a member of group media, however running if section from install scripts

if getent group $app_guid | grep -q "\b${app_uid}\b"; then
  echo "User [$app_uid] did not exist in Group [$app_guid]"
  usermod -a -G $app_guid $app_uid
  echo "Added User [$app_uid] to Group [$app_guid]"
fi

gives:

User [readarr] did not exist in Group [media]
Added User [readarr] to Group [media]

I would expect the script to have returned nil output as user exists and is a member of the expected group. I think if statement should be the same as the prior ones and be testing for 'if user NOT in group'

if ! getent group $app_guid | grep -q "\b${app_uid}\b"; then
  echo "User [$app_uid] did not exist in Group [$app_guid]"
  usermod -a -G $app_guid $app_uid
  echo "Added User [$app_uid] to Group [$app_guid]"
fi

AB#2122

Looks like a good change to me; feel free to add it (on all radarr/readarr/lidarr/Prowlarr

otherwise I'll try to get to it later today

Cool, if you don't mind leaving that to me, I'll do it over the weekend. Will be my first time committing on someone else's GitHub so bear with me.

Yup no problem

you can also just login to the wiki with GitHub and edit the page itself instead of PRing to the repo

whatever is easier