From 45fb1d59fe3ea7e3e8ec6503cf6f03396b8a0312 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Fri, 28 Jan 2022 13:37:31 +0100 Subject: [PATCH] refactoring scripts identiques : pod status --- _podman-common/00_status_pod.sh | 19 +++++++++++++++++++ podman-framadate/00_status.sh | 19 +------------------ podman-jitsi/00_status.sh | 20 +------------------- podman-matrix/00_status.sh | 19 +------------------ podman-matrix/vars.sh | 2 +- podman-seafile/00_status.sh | 20 +------------------- 6 files changed, 24 insertions(+), 75 deletions(-) create mode 100755 _podman-common/00_status_pod.sh mode change 100755 => 120000 podman-framadate/00_status.sh mode change 100755 => 120000 podman-jitsi/00_status.sh mode change 100755 => 120000 podman-matrix/00_status.sh mode change 100755 => 120000 podman-seafile/00_status.sh diff --git a/_podman-common/00_status_pod.sh b/_podman-common/00_status_pod.sh new file mode 100755 index 0000000..7160c32 --- /dev/null +++ b/_podman-common/00_status_pod.sh @@ -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} diff --git a/podman-framadate/00_status.sh b/podman-framadate/00_status.sh deleted file mode 100755 index 12a28d9..0000000 --- a/podman-framadate/00_status.sh +++ /dev/null @@ -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} diff --git a/podman-framadate/00_status.sh b/podman-framadate/00_status.sh new file mode 120000 index 0000000..91862c3 --- /dev/null +++ b/podman-framadate/00_status.sh @@ -0,0 +1 @@ +../_podman-common/00_status_pod.sh \ No newline at end of file diff --git a/podman-jitsi/00_status.sh b/podman-jitsi/00_status.sh deleted file mode 100755 index 7160c32..0000000 --- a/podman-jitsi/00_status.sh +++ /dev/null @@ -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} diff --git a/podman-jitsi/00_status.sh b/podman-jitsi/00_status.sh new file mode 120000 index 0000000..91862c3 --- /dev/null +++ b/podman-jitsi/00_status.sh @@ -0,0 +1 @@ +../_podman-common/00_status_pod.sh \ No newline at end of file diff --git a/podman-matrix/00_status.sh b/podman-matrix/00_status.sh deleted file mode 100755 index 7fa3a1b..0000000 --- a/podman-matrix/00_status.sh +++ /dev/null @@ -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} diff --git a/podman-matrix/00_status.sh b/podman-matrix/00_status.sh new file mode 120000 index 0000000..91862c3 --- /dev/null +++ b/podman-matrix/00_status.sh @@ -0,0 +1 @@ +../_podman-common/00_status_pod.sh \ No newline at end of file diff --git a/podman-matrix/vars.sh b/podman-matrix/vars.sh index 35a2f0a..31a89ee 100644 --- a/podman-matrix/vars.sh +++ b/podman-matrix/vars.sh @@ -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' diff --git a/podman-seafile/00_status.sh b/podman-seafile/00_status.sh deleted file mode 100755 index 7160c32..0000000 --- a/podman-seafile/00_status.sh +++ /dev/null @@ -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} diff --git a/podman-seafile/00_status.sh b/podman-seafile/00_status.sh new file mode 120000 index 0000000..91862c3 --- /dev/null +++ b/podman-seafile/00_status.sh @@ -0,0 +1 @@ +../_podman-common/00_status_pod.sh \ No newline at end of file