Servarr / Wiki

329 stars 59 forks source link

*arrs installation script - unexpected output #165

Closed littlejeem closed 2 years ago

littlejeem commented 2 years ago

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

bakerboy448 commented 2 years ago

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

littlejeem commented 2 years ago

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.

bakerboy448 commented 2 years ago

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

bakerboy448 commented 2 years ago

https://github.com/Servarr/Wiki/commit/8ad74026c114c63ce29f7ca017eab1af7c025bf1 https://github.com/Servarr/Wiki/commit/ae3d8e8709508da03820eb4604d1ed668688a290 https://github.com/Servarr/Wiki/commit/0fd64b93317421d636d3c6477b5a2e9ac89cd0b7 https://github.com/Servarr/Wiki/commit/0e32aa6454b3366563bc58166d5fbbc6fa7ceb4a

https://github.com/Servarr/Wiki/compare/c9bea7178398...8ad74026c114