cleanup scripts: package/addons/

This commit is contained in:
CvH 2024-07-06 13:01:44 +02:00
parent 5275163ab0
commit 99ae3fc3b1
12 changed files with 103 additions and 102 deletions

View File

@ -14,7 +14,7 @@ CHROME_FILE="google-chrome-stable_@CHROME_VERSION@-1_amd64.deb"
# check for enough free disk space
if [ $(df -P . | awk 'END {print $4}') -lt 400000 ]; then
kodi-send --action="Notification(Not enough disk space, at least 400MB are required,30000,${ICON})" >/dev/null
exit 0;
exit 0
fi
# remove install status and folders
@ -41,7 +41,7 @@ rm -f ${CONTROL_FILE} ${DATA_FILE}
(
curl -# -O -C - https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/${CHROME_FILE} 2>${DATA_FILE}
touch ${CONTROL_FILE}
) | \
) |
while [ : ]; do
[ -f ${DATA_FILE} ] && prog="$(tr '\r' '\n' <${DATA_FILE} | tail -n 1 | sed -r 's/^[# ]+/#/;s/^[^0-9]*//g')" || prog=
kodi-send --action="Notification(Downloading Chrome,\"${prog:-0.0%}\",3000,${ICON})" >/dev/null

View File

@ -12,8 +12,7 @@ if [ ! -f "$ADDON_DIR/extract.ok" ]; then
chrome-downloader
fi
if [ -e $ADDON_HOME/env ]
then
if [ -e $ADDON_HOME/env ]; then
. $ADDON_HOME/env
fi
@ -32,8 +31,7 @@ export GDK_PIXBUF_MODULE_FILE=$ADDON_DIR/config/pixbuf.loaders.cache
export XENVIRONMENT=$ADDON_DIR/config/Xdefaults
# start unclutter
if [ "$HIDE_CURSOR" == "true" ]
then
if [ "$HIDE_CURSOR" == "true" ]; then
unclutter &
UNCLUTTER_PID=$!
fi
@ -57,19 +55,28 @@ case $VAAPI_MODE in
*)
LIBGL_ALWAYS_SOFTWARE='1'
export LIBGL_ALWAYS_SOFTWARE
;;
esac
export LIBVA_DRIVER_NAME LIBVA_DRIVERS_PATH
# windowed
case $WINDOW_MODE in
'maximized') chrome_OPTS="$chrome_OPTS --start-maximized";;
'kiosk') chrome_OPTS="$chrome_OPTS --kiosk";;
'maximized')
chrome_OPTS="$chrome_OPTS --start-maximized"
;;
'kiosk')
chrome_OPTS="$chrome_OPTS --kiosk"
;;
esac
# rasterization
case $RASTER_MODE in
'off') chrome_OPTS="$chrome_OPTS --disable-accelerated-2d-canvas --disable-gpu-compositing";;
'force') chrome_OPTS="$chrome_OPTS --enable-gpu-rasterization --enable-accelerated-2d-canvas --ignore-gpu-blacklist";;
'off')
chrome_OPTS="$chrome_OPTS --disable-accelerated-2d-canvas --disable-gpu-compositing"
;;
'force')
chrome_OPTS="$chrome_OPTS --enable-gpu-rasterization --enable-accelerated-2d-canvas --ignore-gpu-blacklist"
;;
esac
# alsa
@ -82,8 +89,7 @@ if [ "$AUDIO_DEVICE_TYPE" == "ALSA" ]; then
fi
# dark mode
if [ "$DARK_MODE" == "true" ]
then
if [ "$DARK_MODE" == "true" ]; then
chrome_OPTS="$chrome_OPTS --force-dark-mode"
fi
@ -102,8 +108,7 @@ LD_PRELOAD=/usr/lib/libGL.so $ADDON_DIR/chrome-bin/chrome \
2>&1 | tee $ADDON_LOG_FILE
# kill unclutter
if [ "$HIDE_CURSOR" == "true" ]
then
if [ "$HIDE_CURSOR" == "true" ]; then
kill $UNCLUTTER_PID
fi

View File

@ -9,9 +9,15 @@
HDHR_LOCKFILE="/var/lock/userspace-driver-hdhomerun.lck"
HDHR_LOCKFD=99
# obtain an exclusive lock
exlock() { eval "exec $HDHR_LOCKFD>\"$HDHR_LOCKFILE\""; flock -x $HDHR_LOCKFD; }
exlock() {
eval "exec $HDHR_LOCKFD>\"$HDHR_LOCKFILE\""
flock -x $HDHR_LOCKFD
}
# drop a lock
unlock() { flock -u $HDHR_LOCKFD; flock -xn $HDHR_LOCKFD && rm -f "$HDHR_LOCKFILE"; }
unlock() {
flock -u $HDHR_LOCKFD
flock -xn $HDHR_LOCKFD && rm -f "$HDHR_LOCKFILE"
}
# end locking mechanism
# exclusive lock

View File

@ -14,7 +14,7 @@ JELLYFIN_FILE="jellyfin_@JELLYFIN_VERSION@.tar.xz"
# check for enough free disk space
if [ $(df . | awk 'END {print $4}') -lt 200000 ]; then
kodi-send --action="Notification(Not enough disk space, at least 200MB are required,30000,${ICON})" >/dev/null
exit 0;
exit 0
fi
# remove install status and folders
@ -27,7 +27,7 @@ if [ -d ${ADDON_DIR}/libs ]; then
fi
# create tmp download dir
TEMP_DIR=`mktemp -d`
TEMP_DIR=$(mktemp -d)
mkdir -p ${TEMP_DIR}/tmp_download
if [ -d ${TEMP_DIR}/tmp_download ]; then
@ -44,7 +44,7 @@ rm -f ${CONTROL_FILE} ${DATA_FILE}
(
curl -L -# -O -C - https://repo.jellyfin.org/files/server/portable/stable/v@JELLYFIN_VERSION@/any/${JELLYFIN_FILE} 2>${DATA_FILE}
touch ${CONTROL_FILE}
) | \
) |
while [ : ]; do
[ -f ${DATA_FILE} ] && prog="$(tr '\r' '\n' <${DATA_FILE} | tail -n 1 | sed -r 's/^[# ]+/#/;s/^[^0-9]*//g')" || prog=
kodi-send --action="Notification(Downloading Jellyfin,\"${prog:-0.0%}\",3000,${ICON})" >/dev/null

View File

@ -6,10 +6,10 @@
. /etc/profile
oe_setup_addon service.system.syncthing
STNODEFAULTFOLDER="1" syncthing -home=$ADDON_HOME \
STNODEFAULTFOLDER="1" syncthing \
-home=$ADDON_HOME \
-gui-address="$gui_address" \
-logflags=0 \
-no-browser \
-no-restart \
&

View File

@ -3,8 +3,7 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
if [ $# -lt 1 ]
then
if [ $# -lt 1 ]; then
. /etc/profile
ADDON_HOME="$HOME/.kodi/userdata/addon_data/service.tvheadend42"
@ -53,24 +52,20 @@ dflag=
vflag=
cflag=
for a in "$@"
do
for a in "$@"; do
[ "$a" = "-d" -o "$a" = "--description" ] && dflag=1
[ "$a" = "-v" -o "$a" = "--version" ] && vflag=1
[ "$a" = "-c" -o "$a" = "--capabilities" ] && cflag=1
done
if [ -n "$dflag" ]
then
if [ -n "$dflag" ]; then
echo "tv_grab_file is a simple grabber that can be configured through the addon settings from Kodi"
fi
if [ -n "$vflag" ]
then
if [ -n "$vflag" ]; then
echo "1.0"
fi
if [ -n "$cflag" ]
then
if [ -n "$cflag" ]; then
echo "baseline"
fi

View File

@ -3,8 +3,7 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
if [ $# -lt 1 ]
then
if [ $# -lt 1 ]; then
. /etc/profile
ADDON_HOME="$HOME/.kodi/userdata/addon_data/service.tvheadend43"
@ -53,24 +52,20 @@ dflag=
vflag=
cflag=
for a in "$@"
do
for a in "$@"; do
[ "$a" = "-d" -o "$a" = "--description" ] && dflag=1
[ "$a" = "-v" -o "$a" = "--version" ] && vflag=1
[ "$a" = "-c" -o "$a" = "--capabilities" ] && cflag=1
done
if [ -n "$dflag" ]
then
if [ -n "$dflag" ]; then
echo "tv_grab_file is a simple grabber that can be configured through the addon settings from Kodi"
fi
if [ -n "$vflag" ]
then
if [ -n "$vflag" ]; then
echo "1.0"
fi
if [ -n "$cflag" ]
then
if [ -n "$cflag" ]; then
echo "baseline"
fi