refactoring scripts identiques : pod status

This commit is contained in:
Gitouche 2022-01-28 13:37:31 +01:00
parent db91296893
commit 45fb1d59fe
6 changed files with 24 additions and 75 deletions

19
_podman-common/00_status_pod.sh Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
echo "Podman images status..."
for image in ${upstream_images} ; do
podman images ${image} | grep ${image} || echo Image ${image} not found.
done
echo
echo "Checking pod status..."
podman pod ps | grep ${pod_name} || echo Pod ${pod_name} not found.
echo
echo "Checking systemd unit status..."
systemctl --user status ${service_name}

View file

@ -1,18 +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
echo "Podman images status..."
for image in ${upstream_images} ; do
podman images ${image} | grep ${image} || echo Image ${image} not found.
done
echo "Checking pod status..."
podman pod ps | grep ${pod_name} || echo Pod ${pod_name} not found.
echo
echo "Checking systemd unit status..."
systemctl --user status ${service_name}

View file

@ -0,0 +1 @@
../_podman-common/00_status_pod.sh

View file

@ -1,19 +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
echo "Podman images status..."
for image in ${upstream_images} ; do
podman images ${image} | grep ${image} || echo Image ${image} not found.
done
echo
echo "Checking pod status..."
podman pod ps | grep ${pod_name} || echo Pod ${pod_name} not found.
echo
echo "Checking systemd unit status..."
systemctl --user status ${service_name}

1
podman-jitsi/00_status.sh Symbolic link
View file

@ -0,0 +1 @@
../_podman-common/00_status_pod.sh

View file

@ -1,18 +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
echo "Podman images status..."
podman images ${synapse_image} | grep ${synapse_image} || echo Image ${synapse_image} not found.
podman images ${postgres_image} | grep ${postgres_image} || echo Image ${postgres_image} not found.
echo
echo "Checking pod status..."
podman pod ps | grep ${pod_name} || echo Pod ${pod_name} not found.
echo
echo "Checking systemd unit status..."
systemctl --user status ${service_name}

1
podman-matrix/00_status.sh Symbolic link
View file

@ -0,0 +1 @@
../_podman-common/00_status_pod.sh

View file

@ -2,12 +2,12 @@
pod_name='podman-matrix'
service_name="pod-${pod_name}.service"
#upstream_images="docker.io/matrixdotorg/synapse docker.io/library/postgres"
#version='latest'
synapse_image="docker.io/matrixdotorg/synapse"
synapse_version='v1.49.2'
postgres_image="docker.io/library/postgres"
postgres_version='11.14'
upstream_images="${synapse_image} ${postgres_image}"
confvolume='matrixdotorg_synapse-data'
dbvolume='matrixdotorg_synapse-pgsql'
container_name='synapse'

View file

@ -1,19 +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
echo "Podman images status..."
for image in ${upstream_images} ; do
podman images ${image} | grep ${image} || echo Image ${image} not found.
done
echo
echo "Checking pod status..."
podman pod ps | grep ${pod_name} || echo Pod ${pod_name} not found.
echo
echo "Checking systemd unit status..."
systemctl --user status ${service_name}

1
podman-seafile/00_status.sh Symbolic link
View file

@ -0,0 +1 @@
../_podman-common/00_status_pod.sh