From c5acd253ac246e05086faa66934cba2bf76d3be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 16 Nov 2021 12:03:28 +0100 Subject: [PATCH] Set full path to pct --- proxmox/proxmox.template.debian.upgrade.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/proxmox/proxmox.template.debian.upgrade.sh b/proxmox/proxmox.template.debian.upgrade.sh index ef7ec7c..90e9bdb 100755 --- a/proxmox/proxmox.template.debian.upgrade.sh +++ b/proxmox/proxmox.template.debian.upgrade.sh @@ -125,7 +125,7 @@ is_lxc_container_absent() { # {{{ return_is_lxc_container_absent="0" ## Check if the system runs on a PVE kernel - if ! pct list -- | grep --quiet "${local_ct_id}"; + if ! /usr/sbin/pct list -- | grep --quiet "${local_ct_id}"; then return_is_lxc_container_absent="0" debug_message "is_lxc_container_absent − \ @@ -146,7 +146,7 @@ is_lxc_container_state() { # {{{ local_ct_state="${2}" ## Compare the status of the LXC container with argument - if pct status "${local_ct_id}" -- | grep --quiet --word-regexp "${local_ct_state}"; + if /usr/sbin/pct status "${local_ct_id}" -- | grep --quiet --word-regexp "${local_ct_state}"; then return_is_lxc_container_state="0" debug_message "is_lxc_container_state − \ @@ -169,7 +169,7 @@ start_lxc_container() { # {{{ return_start_lxc_container="1" ## Start LXC container state - pct start "${local_ct_id}" || exit 1 + /usr/sbin/pct start "${local_ct_id}" || exit 1 ## Wait a little for the container to start sleep "${sleep_delay}" @@ -198,7 +198,7 @@ stop_lxc_container() { # {{{ return_stop_lxc_container="1" ## Stop LXC container state - pct stop "${local_ct_id}" || exit 1 + /usr/sbin/pct stop "${local_ct_id}" || exit 1 ## Wait a little for the container to stop sleep "${sleep_delay}" @@ -225,13 +225,13 @@ upgrade_container() { # {{{ ## Keep output if DEBUG mode is activated if [ "${DEBUG}" -eq "0" ]; then - pct exec "${local_ct_id:-/dev/null}" -- bash -c "wget https://git.ipr.univ-rennes1.fr/cellinfo/scripts/raw/master/proxmox/proxmox.template.debian.sh --output-document=/tmp/proxmox.template.debian.sh" || exit 2 - pct exec "${local_ct_id:-/dev/null}" -- bash -c "chmod +x /tmp/proxmox.template.debian.sh" || exit 2 - pct exec "${local_ct_id:-/dev/null}" -- bash -c "/tmp/proxmox.template.debian.sh" || exit 2 + /usr/sbin/pct exec "${local_ct_id:-/dev/null}" -- bash -c "wget https://git.ipr.univ-rennes1.fr/cellinfo/scripts/raw/master/proxmox/proxmox.template.debian.sh --output-document=/tmp/proxmox.template.debian.sh" || exit 2 + /usr/sbin/pct exec "${local_ct_id:-/dev/null}" -- bash -c "chmod +x /tmp/proxmox.template.debian.sh" || exit 2 + /usr/sbin/pct exec "${local_ct_id:-/dev/null}" -- bash -c "/tmp/proxmox.template.debian.sh" || exit 2 else - pct exec "${local_ct_id:-/dev/null}" -- bash -c "wget --quiet https://git.ipr.univ-rennes1.fr/cellinfo/scripts/raw/master/proxmox/proxmox.template.debian.sh --output-document=/tmp/proxmox.template.debian.sh" || exit 2 - pct exec "${local_ct_id:-/dev/null}" -- bash -c "chmod +x /tmp/proxmox.template.debian.sh" || exit 2 - pct exec "${local_ct_id:-/dev/null}" -- bash -c "/tmp/proxmox.template.debian.sh" > /dev/null 2>&1 || exit 2 + /usr/sbin/pct exec "${local_ct_id:-/dev/null}" -- bash -c "wget --quiet https://git.ipr.univ-rennes1.fr/cellinfo/scripts/raw/master/proxmox/proxmox.template.debian.sh --output-document=/tmp/proxmox.template.debian.sh" || exit 2 + /usr/sbin/pct exec "${local_ct_id:-/dev/null}" -- bash -c "chmod +x /tmp/proxmox.template.debian.sh" || exit 2 + /usr/sbin/pct exec "${local_ct_id:-/dev/null}" -- bash -c "/tmp/proxmox.template.debian.sh" > /dev/null 2>&1 || exit 2 fi }