From 5d6cec1dd7925cba2ef94a20596721d98d71216e Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 28 Apr 2024 06:25:43 -0400 Subject: [PATCH 1/6] Update scrypted-install.sh Add Unprivileged Hardware Acceleration --- install/scrypted-install.sh | 38 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/install/scrypted-install.sh b/install/scrypted-install.sh index a85c2271d..6e54f790c 100644 --- a/install/scrypted-install.sh +++ b/install/scrypted-install.sh @@ -35,22 +35,20 @@ $STD apt-get -y install \ sudo \ mc \ ca-certificates \ - gnupg + gpg msg_ok "Installed Dependencies" +msg_info "Setting Up Hardware Acceleration" +$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} if [[ "$CTTYPE" == "0" ]]; then - msg_info "Setting Up Hardware Acceleration" - $STD apt-get -y install \ - va-driver-all \ - ocl-icd-libopencl1 \ - intel-opencl-icd chgrp video /dev/dri chmod 755 /dev/dri chmod 660 /dev/dri/* $STD adduser $(id -u -n) video $STD adduser $(id -u -n) render - msg_ok "Set Up Hardware Acceleration" fi +msg_ok "Set Up Hardware Acceleration" + msg_info "Installing GStreamer (Patience)" $STD apt-get -y install \ gstreamer1.0-tools \ @@ -98,24 +96,19 @@ $STD python3 -m pip install --upgrade pip $STD python3 -m pip install aiofiles debugpy typing_extensions typing msg_ok "Installed Python3 Dependencies" -read -r -p "Would you like to add Coral Edge TPU support? " prompt -if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then -msg_info "Adding Coral Edge TPU Support" -wget -qO /etc/apt/trusted.gpg.d/coral-repo.asc "https://packages.cloud.google.com/apt/doc/apt-key.gpg" -echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" >/etc/apt/sources.list.d/coral-edgetpu.list -$STD apt-get -y update -$STD apt-get -y install libedgetpu1-std -msg_ok "Coral Edge TPU Support Added" -fi - msg_info "Installing Scrypted" $STD npx -y scrypted@latest install-server -sed -i -e 's/^sgx:x:104:$/render:x:104:root/' -e 's/^render:x:106:root$/sgx:x:106:/' /etc/group + +if [[ "$CTTYPE" == "0" ]]; then + sed -i -e 's/^sgx:x:104:$/render:x:104:root/' -e 's/^render:x:106:root$/sgx:x:106:/' /etc/group +else + sed -i -e 's/^sgx:x:104:$/render:x:104:/' -e 's/^render:x:106:$/sgx:x:106:/' /etc/group +fi msg_ok "Installed Scrypted" msg_info "Creating Service" -service_path="/etc/systemd/system/scrypted.service" -echo "[Unit] +cat </etc/systemd/system/scrypted.service +[Unit] Description=Scrypted service After=network.target @@ -128,8 +121,9 @@ Restart=on-failure RestartSec=3 [Install] -WantedBy=multi-user.target" >$service_path -$STD systemctl enable --now scrypted.service +WantedBy=multi-user.target +EOF +systemctl enable -q --now scrypted.service msg_ok "Created Service" motd_ssh From 90f696461e8c4b68a6196963904a48c64122dafb Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 28 Apr 2024 06:56:08 -0400 Subject: [PATCH 2/6] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c2bd0dd1..a2646902b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ - All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment. - 🚨 **The scripts in the repository will no longer provide support for Proxmox VE 7 starting from July 2024 (scripts will not execute on PVE7). Subsequent Proxmox VE - Support Lifecycle** +## 2024-04-28 + +### Changed + +- **Scrypted LXC** + - Unprivileged Hardware Acceleration + ## 2024-04-27 ### Changed From 6c3c39b79ca19f5fc0dea2d21bc695135fed54ca Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 28 Apr 2024 09:06:03 -0400 Subject: [PATCH 3/6] Update emby-install.sh Add Unprivileged Hardware Acceleration --- install/emby-install.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install/emby-install.sh b/install/emby-install.sh index 721581832..99f5ebfe8 100644 --- a/install/emby-install.sh +++ b/install/emby-install.sh @@ -19,23 +19,27 @@ $STD apt-get install -y sudo $STD apt-get install -y mc msg_ok "Installed Dependencies" +msg_info "Setting Up Hardware Acceleration" +$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} if [[ "$CTTYPE" == "0" ]]; then - msg_info "Setting Up Hardware Acceleration" - $STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} chgrp video /dev/dri chmod 755 /dev/dri chmod 660 /dev/dri/* $STD adduser $(id -u -n) video $STD adduser $(id -u -n) render - msg_ok "Set Up Hardware Acceleration" fi +msg_ok "Set Up Hardware Acceleration" LATEST=$(curl -sL https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep '"tag_name":' | cut -d'"' -f4) msg_info "Installing Emby" wget -q https://github.com/MediaBrowser/Emby.Releases/releases/download/${LATEST}/emby-server-deb_${LATEST}_amd64.deb $STD dpkg -i emby-server-deb_${LATEST}_amd64.deb -sed -i -e 's/^ssl-cert:x:104:$/render:x:104:root,emby/' -e 's/^render:x:108:root,emby$/ssl-cert:x:108:/' /etc/group +if [[ "$CTTYPE" == "0" ]]; then + sed -i -e 's/^ssl-cert:x:104:$/render:x:104:root,emby/' -e 's/^render:x:108:root,emby$/ssl-cert:x:108:/' /etc/group +else + sed -i -e 's/^ssl-cert:x:104:$/render:x:104:emby/' -e 's/^render:x:108:emby$/ssl-cert:x:108:/' /etc/group +fi msg_ok "Installed Emby" motd_ssh From a75f383568f70ecc5178f01b1a576020efc1bdb9 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 28 Apr 2024 09:07:07 -0400 Subject: [PATCH 4/6] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2646902b..79b0c0353 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ - **Scrypted LXC** - Unprivileged Hardware Acceleration +- **Emby LXC** + - Unprivileged Hardware Acceleration ## 2024-04-27 From 869a95d22137bfc491d958263d602b1f283f477b Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 28 Apr 2024 17:42:47 -0400 Subject: [PATCH 5/6] Update glances.sh Add uninstall function --- misc/glances.sh | 84 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 19 deletions(-) diff --git a/misc/glances.sh b/misc/glances.sh index c40af8b40..8a0309bee 100644 --- a/misc/glances.sh +++ b/misc/glances.sh @@ -29,17 +29,8 @@ HOLD=" " CM="${GN}✓${CL}" APP="Glances" hostname="$(hostname)" - -header_info -while true; do - read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn - case $yn in - [Yy]*) break ;; - [Nn]*) exit ;; - *) echo "Please answer yes or no." ;; - esac -done - +silent() { "$@" >/dev/null 2>&1; } +set -e spinner() { local chars="/-\|" local spin_i=0 @@ -64,10 +55,27 @@ msg_ok() { echo -e "${BFR} ${CM} ${GN}${msg}${CL}" } -msg_info "Installing $APP" -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -bash -c "$(wget -qLO - https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/install.sh)" &>/dev/null -cat </etc/systemd/system/glances.service +install() { + header_info + while true; do + read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn + case $yn in + [Yy]*) break ;; + [Nn]*) exit ;; + *) echo "Please answer yes or no." ;; + esac + done + header_info + read -r -p "Verbose mode? " prompt + if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then + STD="" + else + STD="silent" + fi + msg_info "Installing $APP" + rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED + $STD bash -c "$(wget -qLO - https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/install.sh)" + cat </etc/systemd/system/glances.service [Unit] Description=Glances - An eye on your system After=network.target @@ -80,8 +88,46 @@ Restart=on-failure [Install] WantedBy=multi-user.target EOF -systemctl enable -q --now glances.service -msg_ok "Installed $APP on $hostname" + systemctl enable -q --now glances.service + msg_ok "Installed $APP on $hostname" -echo -e "${APP} should be reachable by going to the following URL. - ${BL}http://$IP:61208${CL} \n" + echo -e "${APP} should be reachable by going to the following URL. + ${BL}http://$IP:61208${CL} \n" +} +uninstall() { + header_info + read -r -p "Verbose mode? " prompt + if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then + STD="" + else + STD="silent" + fi + header_info + + msg_info "Uninstalling $APP" + if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi + systemctl disable -q --now glances + bash -c "$(wget -qLO - https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/uninstall.sh)" + rm -rf /etc/systemd/system/glances.service + msg_ok "Uninstalled $APP" + msg_ok "Completed Successfully!\n" +} + +OPTIONS=(Install "Install $APP" \ + Uninstall "Uninstall $APP") + +CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "$APP" --menu "Select an option:" 10 58 2 \ + "${OPTIONS[@]}" 3>&1 1>&2 2>&3) + +case $CHOICE in + "Install") + install + ;; + "Uninstall") + uninstall + ;; + *) + echo "Exiting..." + exit 0 + ;; +esac From 01c54ab916ee39b064fbc46b06739f88ee867819 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 28 Apr 2024 17:49:04 -0400 Subject: [PATCH 6/6] Update glances.sh tweak --- misc/glances.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/misc/glances.sh b/misc/glances.sh index 8a0309bee..318409776 100644 --- a/misc/glances.sh +++ b/misc/glances.sh @@ -96,14 +96,6 @@ EOF } uninstall() { header_info - read -r -p "Verbose mode? " prompt - if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then - STD="" - else - STD="silent" - fi - header_info - msg_info "Uninstalling $APP" if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi systemctl disable -q --now glances