Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Sam Heinz
2024-04-29 11:04:36 +10:00
4 changed files with 90 additions and 44 deletions

View File

@@ -10,6 +10,15 @@
- 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 <a href='https://forum.proxmox.com/threads/proxmox-ve-support-lifecycle.35755/' target='_blank' rel='noopener noreferrer'>Proxmox VE - Support Lifecycle</a>**
## 2024-04-28
### Changed
- **Scrypted LXC**
- Unprivileged Hardware Acceleration
- **Emby LXC**
- Unprivileged Hardware Acceleration
## 2024-04-27
### Changed

View File

@@ -20,23 +20,27 @@ $STD apt-get install -y mc
$STD apt-get install -y wget
msg_ok "Installed Dependencies"
if [[ "$CTTYPE" == "0" ]]; then
msg_info "Setting Up Hardware Acceleration"
$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,vainfo}
if [[ "$CTTYPE" == "0" ]]; then
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}_arm64.deb
$STD dpkg -i emby-server-deb_${LATEST}_arm64.deb
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

View File

@@ -35,22 +35,21 @@ $STD apt-get -y install \
sudo \
mc \
ca-certificates \
gnupg \
gpg \
wget
msg_ok "Installed Dependencies"
if [[ "$CTTYPE" == "0" ]]; then
msg_info "Setting Up Hardware Acceleration"
$STD apt-get -y install \
va-driver-all \
ocl-icd-libopencl1
$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,vainfo}
if [[ "$CTTYPE" == "0" ]]; then
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 \
@@ -99,24 +98,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? <y/N> " 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
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 <<EOF >/etc/systemd/system/scrypted.service
[Unit]
Description=Scrypted service
After=network.target
@@ -129,8 +123,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

View File

@@ -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,9 +55,26 @@ msg_ok() {
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
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? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
STD=""
else
STD="silent"
fi
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
$STD bash -c "$(wget -qLO - https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/install.sh)"
cat <<EOF >/etc/systemd/system/glances.service
[Unit]
Description=Glances - An eye on your system
@@ -85,3 +93,33 @@ msg_ok "Installed $APP on $hostname"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://$IP:61208${CL} \n"
}
uninstall() {
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