Backup /config/qBittorrent/BT_backup/ before we copy anything Rename /config/data/qBittorrent/BT_backup/ after copy so we don't do it again.
25 lines
759 B
Plaintext
25 lines
759 B
Plaintext
#!/usr/bin/with-contenv bash
|
||
|
||
# make our folder
|
||
mkdir -p /config/qBittorrent
|
||
|
||
# copy config
|
||
[[ ! -e /config/qBittorrent/qBittorrent.conf ]] && \
|
||
cp /defaults/qBittorrent.conf /config/qBittorrent/qBittorrent.conf
|
||
|
||
# v4.3.3 BT_backup migration
|
||
[[ -d /config/data/qBittorrent/BT_backup/ ]] && \
|
||
mv /config/qBittorrent/BT_backup/ /config/qBittorrent/BT_backup.bak/ && \
|
||
mkdir /config/qBittorrent/BT_backup/ && \
|
||
cp -a /config/data/qBittorrent/BT_backup/. /config/qBittorrent/BT_backup/ && \
|
||
mv /config/data/qBittorrent/BT_backup/ /config/data/qBittorrent/BT_backup.old/
|
||
|
||
# chown download directory if currently not set to abc
|
||
if [[ "$(stat -c '%U' /downloads)" != "abc" ]]; then
|
||
chown -R abc:abc /downloads
|
||
fi
|
||
|
||
# permissions
|
||
chown -R abc:abc \
|
||
/config
|