From 6e31334d74e248bc7fba35a2cc2b200ed500d1d7 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sun, 9 May 2021 18:18:28 +0200 Subject: [PATCH] [experimental] des corrections peerjs-server --- functions.sh | 2 +- podman-peerjs/00_status.sh | 2 +- podman-peerjs/20_enable.sh | 3 +-- podman-peerjs/80_destroy.sh | 3 ++- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions.sh b/functions.sh index c8a6878..68ee286 100644 --- a/functions.sh +++ b/functions.sh @@ -42,5 +42,5 @@ check_container_exists () { } check_container_running () { - [[ $("podman container inspect -f '{{.State.Status}}' ${1}") == "running" ]] || exit 1 + [[ "podman container inspect -f '{{.State.Status}}' ${1}" != "running" ]] } diff --git a/podman-peerjs/00_status.sh b/podman-peerjs/00_status.sh index 97cc3ce..f525f91 100755 --- a/podman-peerjs/00_status.sh +++ b/podman-peerjs/00_status.sh @@ -8,7 +8,7 @@ ensure_pwd_is_scriptdir ensure_not_root echo "Checking podman images..." -podman images ${image_name} +podman images ${upstream_image} echo "Checking container status..." podman ps -a | grep ${container_name} echo "Checking systemd unit status..." diff --git a/podman-peerjs/20_enable.sh b/podman-peerjs/20_enable.sh index 99714ce..203e3d6 100755 --- a/podman-peerjs/20_enable.sh +++ b/podman-peerjs/20_enable.sh @@ -16,5 +16,4 @@ ensure_systemd_as_user_dir_exists podman generate systemd --name ${container_name} > ${HOME}/.config/systemd/user/${service_name} podman stop ${container_name} -systemctl --user enable ${service_name} -systemctl --user start ${service_name} +systemctl --user --now enable ${service_name} diff --git a/podman-peerjs/80_destroy.sh b/podman-peerjs/80_destroy.sh index 7722a7b..76aecdd 100755 --- a/podman-peerjs/80_destroy.sh +++ b/podman-peerjs/80_destroy.sh @@ -20,11 +20,12 @@ check_systemd_unit_running ${service_name} && { } # FAIL if container is running -check_container_running ${container_name} && { +check_container_running ${container_name} || { echo Container ${container_name} is running. Stop it first. exit 1 } rm -f ${HOME}/.config/systemd/user/${service_name} +systemctl --user disable ${service_name} systemctl --user daemon-reload podman rm ${container_name}