Set full path to pct

This commit is contained in:
Jeremy Gardais 2021-11-16 12:03:28 +01:00
parent 123f5afaa2
commit c5acd253ac
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 10 additions and 10 deletions

View File

@ -125,7 +125,7 @@ is_lxc_container_absent() { # {{{
return_is_lxc_container_absent="0" return_is_lxc_container_absent="0"
## Check if the system runs on a PVE kernel ## 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 then
return_is_lxc_container_absent="0" return_is_lxc_container_absent="0"
debug_message "is_lxc_container_absent \ debug_message "is_lxc_container_absent \
@ -146,7 +146,7 @@ is_lxc_container_state() { # {{{
local_ct_state="${2}" local_ct_state="${2}"
## Compare the status of the LXC container with argument ## 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 then
return_is_lxc_container_state="0" return_is_lxc_container_state="0"
debug_message "is_lxc_container_state \ debug_message "is_lxc_container_state \
@ -169,7 +169,7 @@ start_lxc_container() { # {{{
return_start_lxc_container="1" return_start_lxc_container="1"
## Start LXC container state ## 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 ## Wait a little for the container to start
sleep "${sleep_delay}" sleep "${sleep_delay}"
@ -198,7 +198,7 @@ stop_lxc_container() { # {{{
return_stop_lxc_container="1" return_stop_lxc_container="1"
## Stop LXC container state ## 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 ## Wait a little for the container to stop
sleep "${sleep_delay}" sleep "${sleep_delay}"
@ -225,13 +225,13 @@ upgrade_container() { # {{{
## Keep output if DEBUG mode is activated ## Keep output if DEBUG mode is activated
if [ "${DEBUG}" -eq "0" ]; then 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 /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
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 "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 "/tmp/proxmox.template.debian.sh" || exit 2
else 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 /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
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 "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 "/tmp/proxmox.template.debian.sh" > /dev/null 2>&1 || exit 2
fi fi
} }