diff --git a/distribution/debian/config b/distribution/debian/config index 18d4721b2..fb68205ff 100644 --- a/distribution/debian/config +++ b/distribution/debian/config @@ -8,7 +8,10 @@ db_input high sonarr/owning_group || true db_endblock db_go +db_beginblock +db_input low sonarr/owning_umask || true db_input low sonarr/config_directory || true +db_endblock db_go exit 0 diff --git a/distribution/debian/postinst b/distribution/debian/postinst index e12d78b92..8875d672e 100644 --- a/distribution/debian/postinst +++ b/distribution/debian/postinst @@ -9,6 +9,8 @@ db_get sonarr/owning_user USER="$RET" db_get sonarr/owning_group GROUP="$RET" +db_get sonarr/owning_umask +UMASK="$RET" db_get sonarr/config_directory CONFDIR="$RET" @@ -92,7 +94,7 @@ fi chown -R $USER:$GROUP /usr/lib/sonarr # Update sonarr.service file -sed -i "s:User=sonarr:User=$USER:g; s:Group=sonarr:Group=$GROUP:g; s:-data=/var/lib/sonarr:-data=$CONFDIR:g" /lib/systemd/system/sonarr.service +sed -i "s:User=\w*:User=$USER:g; s:Group=\w*:Group=$GROUP:g; s:UMask=[0-9]*:UMask=$UMASK:g; s:-data=.*$:-data=$CONFDIR:g" /lib/systemd/system/sonarr.service #BEGIN BUILTIN UPDATER if [ "$UPDATER" = "BuiltIn" ]; then diff --git a/distribution/debian/templates b/distribution/debian/templates index ba3cf2615..40c7746f1 100644 --- a/distribution/debian/templates +++ b/distribution/debian/templates @@ -14,6 +14,12 @@ Description: Sonarr group: Any media files created by Sonarr will be writeable by this group. It's advisable to keep the group the same between download client, Sonarr and media centers. +Template: sonarr/owning_umask +Type: string +Default: 0002 +Description: Sonarr umask: + Specifies the umask of the files created by Sonarr. 0002 means the files will be created with 664 as permissions. + Template: sonarr/config_directory Type: string Default: /var/lib/sonarr