2018-10-27 17:43:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2018-01-26 19:30:13 +00:00
|
|
|
USER="sonarr"
|
|
|
|
|
|
|
|
# Add User
|
|
|
|
if ! getent passwd "$USER" >/dev/null; then
|
|
|
|
adduser --quiet --system --shell /bin/bash --home /var/opt/sonarr --group "$USER"
|
|
|
|
|
|
|
|
if ! getent group "$USER" >/dev/null; then
|
|
|
|
groupadd "$USER"
|
|
|
|
usermod -a -G "$USER" "$USER"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-10-27 17:43:41 +00:00
|
|
|
# Create home directory
|
2018-01-26 19:30:13 +00:00
|
|
|
if [ ! -d /var/opt/sonarr ]; then
|
|
|
|
mkdir -p /var/opt/sonarr
|
2018-10-27 17:43:41 +00:00
|
|
|
chown -R $USER: /var/opt/sonarr
|
2018-01-26 19:30:13 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Set permissions on /opt/sonarr
|
2018-10-27 17:43:41 +00:00
|
|
|
chown -R $USER: /opt/sonarr
|
2018-01-26 19:30:13 +00:00
|
|
|
|
2018-10-27 17:43:41 +00:00
|
|
|
#DEBHELPER#
|