From fc1aa3c3432aea910526feb2819e8299fcfda682 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sun, 20 Feb 2022 12:40:56 +0100 Subject: [PATCH] Mise en place suppression automatique nonpersistent_volumes. + utilisation avec privatebin --- _podman-common/80_destroy_container.sh | 4 ++++ _podman-common/80_destroy_pod.sh | 4 ++++ podman-privatebin/80_destroy.sh | 14 +------------- 3 files changed, 9 insertions(+), 13 deletions(-) mode change 100755 => 120000 podman-privatebin/80_destroy.sh diff --git a/_podman-common/80_destroy_container.sh b/_podman-common/80_destroy_container.sh index 4697dfe..a75451d 100755 --- a/_podman-common/80_destroy_container.sh +++ b/_podman-common/80_destroy_container.sh @@ -18,3 +18,7 @@ ${ABSDIR}/70_disable.sh rm -f ${HOME}/.config/systemd/user/${service_name} systemctl --user daemon-reload podman rm ${container_name} + +for volume in ${nonpersistent_volumes}; do + podman volume rm ${volume} +done diff --git a/_podman-common/80_destroy_pod.sh b/_podman-common/80_destroy_pod.sh index d914c41..23d9f04 100755 --- a/_podman-common/80_destroy_pod.sh +++ b/_podman-common/80_destroy_pod.sh @@ -18,3 +18,7 @@ ${ABSDIR}/70_disable.sh rm -f ${HOME}/.config/systemd/user/${service_name} systemctl --user daemon-reload podman pod rm ${pod_name} + +for volume in ${nonpersistent_volumes}; do + podman volume rm ${volume} +done diff --git a/podman-privatebin/80_destroy.sh b/podman-privatebin/80_destroy.sh deleted file mode 100755 index ceb03b1..0000000 --- a/podman-privatebin/80_destroy.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh - -# Run regular prune script for pods -source ${ABSDIR}/../_podman-common/80_destroy_container.sh && -# Remove runtime volumes -for volume in ${nonpersistent_volumes}; do - podman volume rm ${volume} -done - diff --git a/podman-privatebin/80_destroy.sh b/podman-privatebin/80_destroy.sh new file mode 120000 index 0000000..97efd57 --- /dev/null +++ b/podman-privatebin/80_destroy.sh @@ -0,0 +1 @@ +../_podman-common/80_destroy_container.sh \ No newline at end of file