Add Picons
This commit is contained in:
@@ -4,6 +4,34 @@
|
||||
# Executes user customizations on startup
|
||||
# ==============================================================================
|
||||
|
||||
check_picons(){
|
||||
if [ -z "$(ls -A /config/tvheadend/picons)" ]; then return 1; else return 0; fi
|
||||
}
|
||||
|
||||
picons_install(){
|
||||
if apk update; then
|
||||
bashio::log.info '[Picons] APK: Installing required packages.'
|
||||
if apk add --no-cache --virtual .build-deps xz; then
|
||||
bashio::log.info '[Picons] Installing Picons.'
|
||||
bashio::log.info '[Picons] SNP-Picons Download.'
|
||||
wget -O /config/tvheadend/snp.tar.xz $(bashio::config 'snp_url')
|
||||
bashio::log.info '[Picons] SRP-Picons Download.'
|
||||
wget -O /config/tvheadend/srp.tar.xz $(bashio::config 'srp_url')
|
||||
bashio::log.info '[Picons] SNP-Picons extract.'
|
||||
mkdir -p /config/tvheadend/picons/snp
|
||||
tar -xf /config/tvheadend/snp.tar.xz --strip-components=1 -C /config/tvheadend/picons/snp
|
||||
rm /config/tvheadend/snp.tar.xz
|
||||
bashio::log.info '[Picons] SRP-Picons extract.'
|
||||
mkdir -p /config/tvheadend/picons/srp
|
||||
tar -xf /config/tvheadend/srp.tar.xz --strip-components=1 -C /config/tvheadend/picons/srp
|
||||
rm /config/tvheadend/srp.tar.xz
|
||||
bashio::log.info '[Picons] Update config.'
|
||||
sed -i 's|.*chiconpath.*| "chiconpath": "file:///config/tvheadend/picons/snp/%C.png",|g' /config/tvheadend/config
|
||||
sed -i 's|.*piconpath.*| "piconpath": "file:///config/tvheadend/picons/srp",|g' /config/tvheadend/config
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_webgrabplus(){
|
||||
if [ -z "$(ls -A /config/tvheadend/wg++)" ]; then return 1; else return 0; fi
|
||||
}
|
||||
@@ -44,10 +72,21 @@ webgrabplus_install(){
|
||||
# Ensure directory exists
|
||||
if ! bashio::fs.directory_exists '/config/tvheadend/'; then
|
||||
bashio::log.info "Creating default configuration directory at /config/tvheadend/"
|
||||
mkdir -p /config/tvheadend/recordings
|
||||
timeout 20s /usr/bin/tvheadend --firstrun -u root -g root -c /config/tvheadend
|
||||
fi
|
||||
|
||||
if check_picons; then
|
||||
bashio::log.info "[Picons] Picons already installed"
|
||||
else
|
||||
bashio::log.info "[Picons] No Picons installation found"
|
||||
if [ $(bashio::config 'picons') = true ]; then
|
||||
bashio::log.info "[Picons] Installing Picons"
|
||||
picons_install
|
||||
chmod +x /usr/bin/restart_addon
|
||||
exec /usr/bin/restart_addon
|
||||
fi
|
||||
fi
|
||||
|
||||
if check_webgrabplus; then
|
||||
bashio::log.info "[Webgrab+] Webgrab+ already installed"
|
||||
else
|
||||
@@ -60,4 +99,4 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
bashio::log.info '[Webgrab+] Setup completed without errors!!'
|
||||
bashio::log.info 'Setup completed without errors!!'
|
||||
|
||||
Reference in New Issue
Block a user