[experimental] des corrections peerjs-server

This commit is contained in:
Gitouche 2021-05-09 18:18:28 +02:00
parent 832c3c1940
commit 6e31334d74
4 changed files with 5 additions and 5 deletions

View File

@ -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" ]]
}

View File

@ -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..."

View File

@ -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}

View File

@ -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}