mirror of
https://github.com/hassio-addons/addon-tautulli.git
synced 2025-05-04 19:11:24 +00:00
✨Adds suport to use an existing database
This commit is contained in:
parent
4aaab20794
commit
60b7c0987e
3 changed files with 28 additions and 3 deletions
11
README.md
11
README.md
|
@ -166,6 +166,17 @@ panel_iframe:
|
|||
url: http://addres.to.your.hass.io:8181
|
||||
```
|
||||
|
||||
## Use an existing database
|
||||
|
||||
**NB!: This is considered advanced usage.**
|
||||
|
||||
If you want to import an existing Tautulli database to this addon, you first
|
||||
need to extract the `tautulli.db` file from your existing installation.
|
||||
Place this file in this directory `/share/tautulli`, you can use samba,
|
||||
Cloud9 or any other method to move it there.
|
||||
You need to restart the add-on for it to start using this database.
|
||||
_if the directory `/share/tautulli` does not exist you need to create it._
|
||||
|
||||
## Changelog & Releases
|
||||
|
||||
This repository keeps a change log using [GitHub's releases][releases]
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
},
|
||||
"map": [
|
||||
"config",
|
||||
"ssl"
|
||||
"ssl",
|
||||
"share:rw"
|
||||
],
|
||||
"options": {
|
||||
"log_level": "info",
|
||||
|
|
|
@ -6,8 +6,10 @@
|
|||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
CONFIG=/data/config.ini
|
||||
ADDON=/data/addon.ini
|
||||
readonly ADDON=/data/addon.ini
|
||||
readonly CONFIG=/data/config.ini
|
||||
readonly DATABASE=/share/tautulli/tautulli.db
|
||||
readonly SHARE=/share/tautulli
|
||||
|
||||
# If config.ini does not exist, create it.
|
||||
if ! hass.file_exists "/data/config.ini"; then
|
||||
|
@ -71,3 +73,14 @@ fi
|
|||
# Changing config.ini back.
|
||||
## This has to be done because Tautulli added a ini header with [[header]]
|
||||
sed -i "s/\\[get_file_sizes_hold\\]/\\[\\[get_file_sizes_hold\\]\\]/" "$CONFIG"
|
||||
|
||||
# Create /share/tautulli if it does not exist.
|
||||
if ! hass.directory_exists "$SHARE"; then
|
||||
mkdir "$SHARE"
|
||||
fi
|
||||
|
||||
# Use databasefile from /share/tautulli if it exist.
|
||||
if hass.file_exists "$DATABASE"; then
|
||||
hass.log.info "Using database from $DATABASE"
|
||||
ln -sf "$DATABASE" /data/tautulli.db
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue