mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-22 15:56:58 +00:00
25 lines
No EOL
478 B
Bash
25 lines
No EOL
478 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
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
|
|
|
|
# Create home directory
|
|
if [ ! -d /var/opt/sonarr ]; then
|
|
mkdir -p /var/opt/sonarr
|
|
chown -R $USER: /var/opt/sonarr
|
|
fi
|
|
|
|
# Set permissions on /opt/sonarr
|
|
chown -R $USER: /opt/sonarr
|
|
|
|
#DEBHELPER# |