mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-04-19 23:48:06 +00:00
core: a few path corrections (#3769)
This commit is contained in:
parent
495da1bf98
commit
ed29ba3409
@ -40,7 +40,7 @@ function clean_container() {
|
|||||||
header_info
|
header_info
|
||||||
name=$(pct exec "$container" hostname)
|
name=$(pct exec "$container" hostname)
|
||||||
echo -e "${BL}[Info]${GN} Cleaning ${name} ${CL} \n"
|
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
|
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||||
if [[ " ${excluded_containers[@]} " =~ " $container " ]]; then
|
if [[ " ${excluded_containers[@]} " =~ " $container " ]]; then
|
||||||
@ -56,18 +56,18 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
status=$(pct status $container)
|
status=$(pct status "$container")
|
||||||
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
|
template=$(pct config "$container" | grep -q "template:" && echo "true" || echo "false")
|
||||||
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
|
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
|
||||||
echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
|
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"
|
echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"
|
||||||
sleep 5
|
sleep 5
|
||||||
clean_container $container
|
clean_container "$container"
|
||||||
echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n"
|
echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n"
|
||||||
pct shutdown $container &
|
pct shutdown "$container" &
|
||||||
elif [ "$status" == "status: running" ]; then
|
elif [ "$status" == "status: running" ]; then
|
||||||
clean_container $container
|
clean_container "$container"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Author: tteck (tteckster)
|
# Author: tteck (tteckster)
|
||||||
# License: MIT
|
# License: MIT
|
||||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# 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
|
clear
|
||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
@ -25,13 +25,13 @@ add() {
|
|||||||
*) echo "Please answer yes or no." ;;
|
*) echo "Please answer yes or no." ;;
|
||||||
esac
|
esac
|
||||||
done
|
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
|
clear
|
||||||
echo -e "\n To view Cron Update LXCs logs: cat /var/log/update-lxcs-cron.log"
|
echo -e "\n To view Cron Update LXCs logs: cat /var/log/update-lxcs-cron.log"
|
||||||
}
|
}
|
||||||
|
|
||||||
remove() {
|
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
|
rm -rf /var/log/update-lxcs-cron.log
|
||||||
echo "Removed Crontab Schedule from Proxmox VE"
|
echo "Removed Crontab Schedule from Proxmox VE"
|
||||||
}
|
}
|
||||||
|
@ -79,15 +79,15 @@ done
|
|||||||
|
|
||||||
# Add autodev settings
|
# Add autodev settings
|
||||||
CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf
|
CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf
|
||||||
sed '/autodev/d' $CTID_CONFIG_PATH >CTID.conf
|
sed '/autodev/d' "$CTID_CONFIG_PATH" >CTID.conf
|
||||||
cat CTID.conf >$CTID_CONFIG_PATH
|
cat CTID.conf >"$CTID_CONFIG_PATH"
|
||||||
|
|
||||||
cat <<EOF >>$CTID_CONFIG_PATH
|
cat <<EOF >>"$CTID_CONFIG_PATH"
|
||||||
lxc.autodev: 1
|
lxc.autodev: 1
|
||||||
lxc.hook.autodev: bash -c '$HOOK_SCRIPT'
|
lxc.hook.autodev: bash -c '$HOOK_SCRIPT'
|
||||||
EOF
|
EOF
|
||||||
echo -e "\e[1;33m \nFinished....Reboot ${CTID} LXC to apply the changes.\n \e[0m"
|
echo -e "\e[1;33m \nFinished....Reboot ${CTID} LXC to apply the changes.\n \e[0m"
|
||||||
|
|
||||||
# In the Proxmox web shell run
|
# 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
|
# Reboot the LXC to apply the changes
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# License: MIT
|
# License: MIT
|
||||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Execute within the Proxmox shell
|
# 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
|
set -e
|
||||||
function header_info {
|
function header_info {
|
||||||
@ -76,7 +76,7 @@ else
|
|||||||
fi
|
fi
|
||||||
header_info
|
header_info
|
||||||
|
|
||||||
cat <<EOF >>/etc/pve/lxc/${privileged_container}.conf
|
cat <<EOF >>/etc/pve/lxc/"${privileged_container}".conf
|
||||||
lxc.cgroup2.devices.allow: c 226:0 rwm
|
lxc.cgroup2.devices.allow: c 226:0 rwm
|
||||||
lxc.cgroup2.devices.allow: c 226:128 rwm
|
lxc.cgroup2.devices.allow: c 226:128 rwm
|
||||||
lxc.cgroup2.devices.allow: c 29:0 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
|
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||||
header_info
|
header_info
|
||||||
msg_info "Installing Hardware Acceleration (non-free)"
|
msg_info "Installing Hardware Acceleration (non-free)"
|
||||||
pct exec ${privileged_container} -- bash -c "cat <<EOF >/etc/apt/sources.list.d/non-free.list
|
pct exec "${privileged_container}" -- bash -c "cat <<EOF >/etc/apt/sources.list.d/non-free.list
|
||||||
|
|
||||||
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
|
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
|
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
|
deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
|
||||||
EOF"
|
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)"
|
msg_ok "Installed Hardware Acceleration (non-free)"
|
||||||
else
|
else
|
||||||
header_info
|
header_info
|
||||||
msg_info "Installing Hardware Acceleration"
|
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"
|
msg_ok "Installed Hardware Acceleration"
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user