diff --git a/tools/pve/clean-lxcs.sh b/tools/pve/clean-lxcs.sh index 03584cdd5..195210167 100644 --- a/tools/pve/clean-lxcs.sh +++ b/tools/pve/clean-lxcs.sh @@ -40,7 +40,7 @@ function clean_container() { header_info name=$(pct exec "$container" hostname) echo -e "${BL}[Info]${GN} Cleaning ${name} ${CL} \n" - pct exec $container -- bash -c "apt-get -y --purge autoremove && apt-get -y autoclean && bash <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/clean.sh) && rm -rf /var/lib/apt/lists/* && apt-get update" + pct exec "$container" -- bash -c "apt-get -y --purge autoremove && apt-get -y autoclean && bash <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/clean.sh) && rm -rf /var/lib/apt/lists/* && apt-get update" } for container in $(pct list | awk '{if(NR>1) print $1}'); do if [[ " ${excluded_containers[@]} " =~ " $container " ]]; then @@ -56,18 +56,18 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do continue fi - status=$(pct status $container) - template=$(pct config $container | grep -q "template:" && echo "true" || echo "false") + status=$(pct status "$container") + template=$(pct config "$container" | grep -q "template:" && echo "true" || echo "false") if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n" - pct start $container + pct start "$container" echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n" sleep 5 - clean_container $container + clean_container "$container" echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n" - pct shutdown $container & + pct shutdown "$container" & elif [ "$status" == "status: running" ]; then - clean_container $container + clean_container "$container" fi fi done diff --git a/tools/pve/cron-update-lxcs.sh b/tools/pve/cron-update-lxcs.sh index 6cb4da56a..6d6fb3c51 100644 --- a/tools/pve/cron-update-lxcs.sh +++ b/tools/pve/cron-update-lxcs.sh @@ -4,7 +4,7 @@ # Author: tteck (tteckster) # License: MIT # https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/cron-update-lxcs.sh)" +# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/cron-update-lxcs.sh)" clear cat <<"EOF" @@ -25,13 +25,13 @@ add() { *) echo "Please answer yes or no." ;; esac done - sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * 0 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/update-lxcs-cron.sh)\" >>/var/log/update-lxcs-cron.log 2>/dev/null") | crontab -u root -' + sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * 0 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/update-lxcs-cron.sh)\" >>/var/log/update-lxcs-cron.log 2>/dev/null") | crontab -u root -' clear echo -e "\n To view Cron Update LXCs logs: cat /var/log/update-lxcs-cron.log" } remove() { - (crontab -l | grep -v "github.com/community-scripts/ProxmoxVE/raw/main/misc/update-lxcs-cron.sh") | crontab - + (crontab -l | grep -v "update-lxcs-cron.sh") | crontab - rm -rf /var/log/update-lxcs-cron.log echo "Removed Crontab Schedule from Proxmox VE" } diff --git a/tools/pve/frigate-support.sh b/tools/pve/frigate-support.sh index 0c5c93cdb..3ca5ae2ca 100644 --- a/tools/pve/frigate-support.sh +++ b/tools/pve/frigate-support.sh @@ -79,15 +79,15 @@ done # Add autodev settings CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf -sed '/autodev/d' $CTID_CONFIG_PATH >CTID.conf -cat CTID.conf >$CTID_CONFIG_PATH +sed '/autodev/d' "$CTID_CONFIG_PATH" >CTID.conf +cat CTID.conf >"$CTID_CONFIG_PATH" -cat <>$CTID_CONFIG_PATH +cat <>"$CTID_CONFIG_PATH" lxc.autodev: 1 lxc.hook.autodev: bash -c '$HOOK_SCRIPT' EOF echo -e "\e[1;33m \nFinished....Reboot ${CTID} LXC to apply the changes.\n \e[0m" # In the Proxmox web shell run -# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/frigate-support.sh)" +# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/frigate-support.sh)" # Reboot the LXC to apply the changes diff --git a/tools/pve/hw-acceleration.sh b/tools/pve/hw-acceleration.sh index 3c5d4c4bb..649ea1130 100644 --- a/tools/pve/hw-acceleration.sh +++ b/tools/pve/hw-acceleration.sh @@ -5,7 +5,7 @@ # License: MIT # https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Execute within the Proxmox shell -# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/hw-acceleration.sh)" +# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/hw-acceleration.sh)" set -e function header_info { @@ -76,7 +76,7 @@ else fi header_info -cat <>/etc/pve/lxc/${privileged_container}.conf +cat <>/etc/pve/lxc/"${privileged_container}".conf lxc.cgroup2.devices.allow: c 226:0 rwm lxc.cgroup2.devices.allow: c 226:128 rwm lxc.cgroup2.devices.allow: c 29:0 rwm @@ -89,7 +89,7 @@ read -r -p "Do you need the intel-media-va-driver-non-free driver (Debian 12 onl if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then header_info msg_info "Installing Hardware Acceleration (non-free)" - pct exec ${privileged_container} -- bash -c "cat </etc/apt/sources.list.d/non-free.list + pct exec "${privileged_container}" -- bash -c "cat </etc/apt/sources.list.d/non-free.list deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware @@ -101,12 +101,12 @@ deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware EOF" - pct exec ${privileged_container} -- bash -c "silent() { \"\$@\" >/dev/null 2>&1; } && $STD apt-get update && $STD apt-get install -y intel-media-va-driver-non-free ocl-icd-libopencl1 intel-opencl-icd vainfo intel-gpu-tools && $STD adduser \$(id -u -n) video && $STD adduser \$(id -u -n) render" + pct exec "${privileged_container}" -- bash -c "silent() { \"\$@\" >/dev/null 2>&1; } && $STD apt-get update && $STD apt-get install -y intel-media-va-driver-non-free ocl-icd-libopencl1 intel-opencl-icd vainfo intel-gpu-tools && $STD adduser \$(id -u -n) video && $STD adduser \$(id -u -n) render" msg_ok "Installed Hardware Acceleration (non-free)" else header_info msg_info "Installing Hardware Acceleration" - pct exec ${privileged_container} -- bash -c "silent() { \"\$@\" >/dev/null 2>&1; } && $STD apt-get install -y va-driver-all ocl-icd-libopencl1 intel-opencl-icd vainfo intel-gpu-tools && chgrp video /dev/dri && chmod 755 /dev/dri && $STD adduser \$(id -u -n) video && $STD adduser \$(id -u -n) render" + pct exec "${privileged_container}" -- bash -c "silent() { \"\$@\" >/dev/null 2>&1; } && $STD apt-get install -y va-driver-all ocl-icd-libopencl1 intel-opencl-icd vainfo intel-gpu-tools && chgrp video /dev/dri && chmod 755 /dev/dri && $STD adduser \$(id -u -n) video && $STD adduser \$(id -u -n) render" msg_ok "Installed Hardware Acceleration" fi sleep 1