mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-25 18:14:44 +00:00
7cfa47d138
Instead of hard-failing when AVX is not present, detect whether the host CPU supports AVX + AVX2 + MOVBE (x86-64-v3 microarchitecture level) and select the appropriate upstream binary accordingly: - iSponsorBlockTV-x86_64-linux → modern CPUs (AVX/AVX2/MOVBE) - iSponsorBlockTV-x86_64-linux-v1 → any x86_64 CPU (fallback) The same detection logic is applied in update_script() so updates stay consistent with the initially installed binary type. Fixes: https://github.com/community-scripts/ProxmoxVE/issues/14660 Upstream: dmunozv04/iSponsorBlockTV#463
74 lines
1.8 KiB
Bash
74 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: Matthew Stern (sternma) | MickLesk (CanbiZ)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/dmunozv04/iSponsorBlockTV
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
ISBTV_BINARY="iSponsorBlockTV-x86_64-linux-v1"
|
|
if grep -q ' avx ' /proc/cpuinfo 2>/dev/null && grep -q ' avx2 ' /proc/cpuinfo 2>/dev/null && grep -q ' movbe ' /proc/cpuinfo 2>/dev/null; then
|
|
ISBTV_BINARY="iSponsorBlockTV-x86_64-linux"
|
|
fi
|
|
|
|
fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV" "singlefile" "latest" "/opt/isponsorblocktv" "${ISBTV_BINARY}"
|
|
|
|
msg_info "Setting up iSponsorBlockTV"
|
|
install -d /var/lib/isponsorblocktv
|
|
msg_ok "Set up iSponsorBlockTV"
|
|
|
|
msg_info "Creating Service"
|
|
cat <<EOF >/etc/systemd/system/isponsorblocktv.service
|
|
[Unit]
|
|
Description=iSponsorBlockTV
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=root
|
|
Group=root
|
|
Environment=iSPBTV_data_dir=/var/lib/isponsorblocktv
|
|
ExecStart=/opt/isponsorblocktv/isponsorblocktv
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl enable -q isponsorblocktv
|
|
msg_ok "Created Service"
|
|
|
|
msg_info "Creating CLI wrapper"
|
|
cat <<'EOF' >/usr/local/bin/iSponsorBlockTV
|
|
#!/usr/bin/env bash
|
|
export iSPBTV_data_dir="/var/lib/isponsorblocktv"
|
|
|
|
set +e
|
|
/opt/isponsorblocktv/isponsorblocktv "$@"
|
|
status=$?
|
|
set -e
|
|
|
|
case "${1:-}" in
|
|
setup|setup-cli)
|
|
systemctl restart isponsorblocktv >/dev/null 2>&1 || true
|
|
;;
|
|
esac
|
|
|
|
exit $status
|
|
EOF
|
|
chmod +x /usr/local/bin/iSponsorBlockTV
|
|
ln -sf /usr/local/bin/iSponsorBlockTV /usr/bin/iSponsorBlockTV
|
|
msg_ok "Created CLI wrapper"
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|