mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-29 23:12:39 +01:00
Moved from /opt back to /usr/lib based on debian policy.
This commit is contained in:
parent
40a7cf32c5
commit
975fe98cbf
@ -1 +1 @@
|
||||
sonarr_bin/* /opt/sonarr/bin
|
||||
sonarr_bin/* /usr/lib/sonarr/bin
|
||||
|
@ -20,17 +20,28 @@ if ! getent passwd "$USER" >/dev/null; then
|
||||
adduser --system --no-create-home --ingroup "$GROUP" "$USER"
|
||||
fi
|
||||
|
||||
# Migrate old data dir (Sonarr v3 alpha)
|
||||
if [ -d "/var/opt/sonarr" ] && [ "$CONFDIR" != "/var/opt/sonarr" ]; then
|
||||
if [ ! -f "/var/opt/sonarr/sonarr.db" ] && [ -f "/var/opt/sonarr/.config/Sonarr/sonarr.db" ]; then
|
||||
mv "/var/opt/sonarr/.config/Sonarr" "$CONFDIR"
|
||||
rm -rf "/var/opt/sonarr"
|
||||
else
|
||||
mv "/var/opt/sonarr" "$CONFDIR"
|
||||
fi
|
||||
chown -R $USER:$GROUP "$CONFDIR"
|
||||
fi
|
||||
|
||||
# Create data directory
|
||||
if [ ! -d "$CONFDIR" ]; then
|
||||
mkdir -p "$CONFDIR"
|
||||
chown -R $USER:$GROUP "$CONFDIR"
|
||||
fi
|
||||
|
||||
# Set permissions on /opt/sonarr
|
||||
chown -R $USER:$GROUP /opt/sonarr
|
||||
# Set permissions on /usr/lib/sonarr
|
||||
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/opt/sonarr:-data=$CONFDIR:g" $SYSTEMD_UNIT
|
||||
sed -i "s:User=sonarr:User=$USER:g; s:Group=sonarr:Group=$GROUP:g; s:-data=/var/lib/sonarr:-data=$CONFDIR:g" $SYSTEMD_UNIT
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
|
@ -8,7 +8,7 @@ Group=sonarr
|
||||
UMask=002
|
||||
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/mono --debug /opt/sonarr/bin/Sonarr.exe -nobrowser -data=/var/opt/sonarr
|
||||
ExecStart=/usr/bin/mono --debug /usr/lib/sonarr/bin/Sonarr.exe -nobrowser -data=/var/lib/sonarr
|
||||
TimeoutStopSec=20
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
|
Loading…
Reference in New Issue
Block a user