Align to code standards
This commit is contained in:
parent
ad48c14cf3
commit
d25f48f5be
@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Matthew Stern
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Author: Matthew Stern (sternma)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/dmunozv04/iSponsorBlockTV
|
||||
|
||||
APP="iSponsorBlockTV"
|
||||
@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
@ -23,11 +23,44 @@ function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/isponsorblocktv ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_error "Currently we don't provide an update function for ${APP}."
|
||||
|
||||
if check_for_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop isponsorblocktv
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
if [[ -d /var/lib/isponsorblocktv ]]; then
|
||||
msg_info "Backing up Data"
|
||||
cp -r /var/lib/isponsorblocktv /var/lib/isponsorblocktv_data_backup
|
||||
msg_ok "Backed up Data"
|
||||
fi
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV"
|
||||
|
||||
msg_info "Setting up iSponsorBlockTV"
|
||||
$STD python3 -m venv /opt/isponsorblocktv/venv
|
||||
$STD /opt/isponsorblocktv/venv/bin/pip install --upgrade pip
|
||||
$STD /opt/isponsorblocktv/venv/bin/pip install /opt/isponsorblocktv
|
||||
msg_ok "Set up iSponsorBlockTV"
|
||||
|
||||
if [[ -d /var/lib/isponsorblocktv_data_backup ]]; then
|
||||
msg_info "Restoring Data"
|
||||
rm -rf /var/lib/isponsorblocktv
|
||||
cp -r /var/lib/isponsorblocktv_data_backup /var/lib/isponsorblocktv
|
||||
rm -rf /var/lib/isponsorblocktv_data_backup
|
||||
msg_ok "Restored Data"
|
||||
fi
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start isponsorblocktv
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
],
|
||||
"date_created": "2026-01-25",
|
||||
"type": "ct",
|
||||
"updateable": false,
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": null,
|
||||
"documentation": "https://github.com/dmunozv04/iSponsorBlockTV/wiki",
|
||||
"website": "https://github.com/dmunozv04/iSponsorBlockTV",
|
||||
"logo": null,
|
||||
"logo": "https://raw.githubusercontent.com/ajayyy/SponsorBlock/master/public/icons/IconSponsorBlocker512px.png",
|
||||
"config_path": "/var/lib/isponsorblocktv/config.json",
|
||||
"description": "iSponsorBlockTV connects to YouTube TV clients and automatically skips SponsorBlock segments, mutes ads, and presses the Skip Ad button when available.",
|
||||
"install_methods": [
|
||||
@ -23,7 +23,7 @@
|
||||
"ram": 1024,
|
||||
"hdd": 4,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Matthew Stern
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Author: Matthew Stern (sternma)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/dmunozv04/iSponsorBlockTV
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
@ -15,7 +15,6 @@ update_os
|
||||
|
||||
INSTALL_DIR="/opt/isponsorblocktv"
|
||||
DATA_DIR="/var/lib/isponsorblocktv"
|
||||
SERVICE_USER="isponsorblocktv"
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
@ -24,23 +23,17 @@ $STD apt-get install -y \
|
||||
python3-pip
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Downloading iSponsorBlockTV"
|
||||
fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV" "tarball" "latest" "$INSTALL_DIR"
|
||||
msg_ok "Downloaded iSponsorBlockTV"
|
||||
fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV"
|
||||
|
||||
msg_info "Setting up iSponsorBlockTV"
|
||||
python3 -m venv "$INSTALL_DIR/venv"
|
||||
$STD python3 -m venv "$INSTALL_DIR/venv"
|
||||
$STD "$INSTALL_DIR/venv/bin/pip" install --upgrade pip
|
||||
$STD "$INSTALL_DIR/venv/bin/pip" install "$INSTALL_DIR"
|
||||
msg_ok "Set up iSponsorBlockTV"
|
||||
|
||||
msg_info "Creating service user and data directory"
|
||||
if ! id "$SERVICE_USER" &>/dev/null; then
|
||||
useradd --system --home "$DATA_DIR" --create-home "$SERVICE_USER"
|
||||
fi
|
||||
install -d -o "$SERVICE_USER" -g "$SERVICE_USER" "$DATA_DIR"
|
||||
chown -R "$SERVICE_USER":"$SERVICE_USER" "$INSTALL_DIR"
|
||||
msg_ok "Created service user and data directory"
|
||||
msg_info "Creating data directory"
|
||||
install -d "$DATA_DIR"
|
||||
msg_ok "Created data directory"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOT >/etc/systemd/system/isponsorblocktv.service
|
||||
@ -51,8 +44,8 @@ Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=$SERVICE_USER
|
||||
Group=$SERVICE_USER
|
||||
User=root
|
||||
Group=root
|
||||
WorkingDirectory=$INSTALL_DIR
|
||||
Environment=iSPBTV_data_dir=$DATA_DIR
|
||||
ExecStart=$INSTALL_DIR/venv/bin/iSponsorBlockTV
|
||||
@ -93,7 +86,9 @@ cat <<'EOT' >/etc/profile.d/isponsorblocktv.sh
|
||||
export iSPBTV_data_dir="/var/lib/isponsorblocktv"
|
||||
EOT
|
||||
if ! grep -q '^iSPBTV_data_dir=' /etc/environment 2>/dev/null; then
|
||||
echo 'iSPBTV_data_dir=/var/lib/isponsorblocktv' >>/etc/environment
|
||||
cat <<'EOT' >>/etc/environment
|
||||
iSPBTV_data_dir=/var/lib/isponsorblocktv
|
||||
EOT
|
||||
fi
|
||||
msg_ok "Set default data dir for shells"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user