refactoring scripts identiques : pod disable

This commit is contained in:
Gitouche 2022-01-28 13:25:15 +01:00
parent 75ebe2cd66
commit 87e06f592f
5 changed files with 23 additions and 76 deletions

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
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if systemd unit does not exists
ensure_systemd_unit_exists ${service_name}
# FAIL if systemd unit is running (stop it first)
ensure_systemd_unit_not_running ${service_name}
systemctl --user disable ${service_name}

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
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if systemd unit does not exists
ensure_systemd_unit_exists ${service_name}
# FAIL if systemd unit is running (stop it first)
ensure_systemd_unit_not_running ${service_name}
systemctl --user disable ${service_name}

View File

@ -0,0 +1 @@
../_podman-common/70_disable_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
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if systemd unit does not exists
ensure_systemd_unit_exists ${service_name}
# FAIL if systemd unit is running (stop it first)
ensure_systemd_unit_not_running ${service_name}
systemctl --user disable ${service_name}

1
podman-jitsi/70_disable.sh Symbolic link
View File

@ -0,0 +1 @@
../_podman-common/70_disable_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
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if systemd unit does not exists
ensure_systemd_unit_exists ${service_name}
# FAIL if systemd unit is running (stop it first)
ensure_systemd_unit_not_running ${service_name}
systemctl --user disable ${service_name}

1
podman-matrix/70_disable.sh Symbolic link
View File

@ -0,0 +1 @@
../_podman-common/70_disable_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
# FAIL if pod does not exists
ensure_pod_exists ${pod_name}
# FAIL if systemd unit does not exists
ensure_systemd_unit_exists ${service_name}
# FAIL if systemd unit is running (stop it first)
ensure_systemd_unit_not_running ${service_name}
systemctl --user disable ${service_name}

View File

@ -0,0 +1 @@
../_podman-common/70_disable_pod.sh