refactoring scripts identiques : pod destroy

This commit is contained in:
Gitouche 2022-01-28 13:31:22 +01:00
parent 87e06f592f
commit db91296893
5 changed files with 24 additions and 82 deletions

View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if pod is running
ensure_pod_not_running ${pod_name}
${ABSDIR}/70_disable.sh
rm -f ${HOME}/.config/systemd/user/${service_name}
systemctl --user daemon-reload
podman pod rm ${pod_name}

View file

@ -1,20 +0,0 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if pod is running
ensure_pod_not_running ${pod_name}
${ABSDIR}/70_disable.sh
rm -f ${HOME}/.config/systemd/user/${service_name}
systemctl --user daemon-reload
podman pod rm ${pod_name}

View file

@ -0,0 +1 @@
../_podman-common/80_destroy_pod.sh

View file

@ -1,20 +0,0 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if pod is running
ensure_pod_not_running ${pod_name}
${ABSDIR}/70_disable.sh
rm -f ${HOME}/.config/systemd/user/${service_name}
systemctl --user daemon-reload
podman pod rm ${pod_name}

1
podman-jitsi/80_destroy.sh Symbolic link
View file

@ -0,0 +1 @@
../_podman-common/80_destroy_pod.sh

View file

@ -1,22 +0,0 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if pod is running
ensure_pod_not_running ${pod_name}
${ABSDIR}/70_disable.sh
rm -f ${HOME}/.config/systemd/user/${service_name}
rm -f ${HOME}/.config/systemd/user/container-${container_name}.service
rm -f ${HOME}/.config/systemd/user/container-${db_container_name}.service
systemctl --user daemon-reload
podman pod rm ${pod_name}

1
podman-matrix/80_destroy.sh Symbolic link
View file

@ -0,0 +1 @@
../_podman-common/80_destroy_pod.sh

View file

@ -1,20 +0,0 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if pod is running
ensure_pod_not_running ${pod_name}
${ABSDIR}/70_disable.sh
rm -f ${HOME}/.config/systemd/user/${service_name}
systemctl --user daemon-reload
podman pod rm ${pod_name}

View file

@ -0,0 +1 @@
../_podman-common/80_destroy_pod.sh