Skip to content

Commit ed29ba3

Browse files
authored
core: a few path corrections (#3769)
1 parent 495da1b commit ed29ba3

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

tools/pve/clean-lxcs.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function clean_container() {
4040
header_info
4141
name=$(pct exec "$container" hostname)
4242
echo -e "${BL}[Info]${GN} Cleaning ${name} ${CL} \n"
43-
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"
43+
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"
4444
}
4545
for container in $(pct list | awk '{if(NR>1) print $1}'); do
4646
if [[ " ${excluded_containers[@]} " =~ " $container " ]]; then
@@ -56,18 +56,18 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do
5656
continue
5757
fi
5858

59-
status=$(pct status $container)
60-
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
59+
status=$(pct status "$container")
60+
template=$(pct config "$container" | grep -q "template:" && echo "true" || echo "false")
6161
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
6262
echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
63-
pct start $container
63+
pct start "$container"
6464
echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"
6565
sleep 5
66-
clean_container $container
66+
clean_container "$container"
6767
echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n"
68-
pct shutdown $container &
68+
pct shutdown "$container" &
6969
elif [ "$status" == "status: running" ]; then
70-
clean_container $container
70+
clean_container "$container"
7171
fi
7272
fi
7373
done

tools/pve/cron-update-lxcs.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Author: tteck (tteckster)
55
# License: MIT
66
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7-
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/cron-update-lxcs.sh)"
7+
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/cron-update-lxcs.sh)"
88

99
clear
1010
cat <<"EOF"
@@ -25,13 +25,13 @@ add() {
2525
*) echo "Please answer yes or no." ;;
2626
esac
2727
done
28-
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 -'
28+
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 -'
2929
clear
3030
echo -e "\n To view Cron Update LXCs logs: cat /var/log/update-lxcs-cron.log"
3131
}
3232

3333
remove() {
34-
(crontab -l | grep -v "github.com/community-scripts/ProxmoxVE/raw/main/misc/update-lxcs-cron.sh") | crontab -
34+
(crontab -l | grep -v "update-lxcs-cron.sh") | crontab -
3535
rm -rf /var/log/update-lxcs-cron.log
3636
echo "Removed Crontab Schedule from Proxmox VE"
3737
}

tools/pve/frigate-support.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ done
7979

8080
# Add autodev settings
8181
CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf
82-
sed '/autodev/d' $CTID_CONFIG_PATH >CTID.conf
83-
cat CTID.conf >$CTID_CONFIG_PATH
82+
sed '/autodev/d' "$CTID_CONFIG_PATH" >CTID.conf
83+
cat CTID.conf >"$CTID_CONFIG_PATH"
8484

85-
cat <<EOF >>$CTID_CONFIG_PATH
85+
cat <<EOF >>"$CTID_CONFIG_PATH"
8686
lxc.autodev: 1
8787
lxc.hook.autodev: bash -c '$HOOK_SCRIPT'
8888
EOF
8989
echo -e "\e[1;33m \nFinished....Reboot ${CTID} LXC to apply the changes.\n \e[0m"
9090

9191
# In the Proxmox web shell run
92-
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/frigate-support.sh)"
92+
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/frigate-support.sh)"
9393
# Reboot the LXC to apply the changes

tools/pve/hw-acceleration.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# License: MIT
66
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
77
# Execute within the Proxmox shell
8-
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/hw-acceleration.sh)"
8+
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/hw-acceleration.sh)"
99

1010
set -e
1111
function header_info {
@@ -76,7 +76,7 @@ else
7676
fi
7777
header_info
7878

79-
cat <<EOF >>/etc/pve/lxc/${privileged_container}.conf
79+
cat <<EOF >>/etc/pve/lxc/"${privileged_container}".conf
8080
lxc.cgroup2.devices.allow: c 226:0 rwm
8181
lxc.cgroup2.devices.allow: c 226:128 rwm
8282
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
8989
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
9090
header_info
9191
msg_info "Installing Hardware Acceleration (non-free)"
92-
pct exec ${privileged_container} -- bash -c "cat <<EOF >/etc/apt/sources.list.d/non-free.list
92+
pct exec "${privileged_container}" -- bash -c "cat <<EOF >/etc/apt/sources.list.d/non-free.list
9393
9494
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
9595
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
101101
deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
102102
EOF"
103103

104-
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"
104+
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"
105105
msg_ok "Installed Hardware Acceleration (non-free)"
106106
else
107107
header_info
108108
msg_info "Installing Hardware Acceleration"
109-
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"
109+
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"
110110
msg_ok "Installed Hardware Acceleration"
111111
fi
112112
sleep 1

0 commit comments

Comments
 (0)