amelioration peerjs apres quelques tests
This commit is contained in:
parent
d3db64601b
commit
1f3ab1406f
|
@ -60,7 +60,7 @@ ensure_systemd_unit_exists () {
|
|||
# ok if systemd unit file {1} does not exists
|
||||
ensure_systemd_unit_not_exists () {
|
||||
if check_systemd_unit_exists ${1}; then
|
||||
echo "ERROR : systemd unit ${1} already exists!"
|
||||
echo "ERROR : systemd unit ${1} exists!"
|
||||
exit 1
|
||||
else
|
||||
return 0
|
||||
|
@ -110,7 +110,7 @@ ensure_container_exists () {
|
|||
# ok if container does not exists
|
||||
ensure_container_not_exists () {
|
||||
if check_container_exists ${1}; then
|
||||
echo "ERROR : container ${1} already exists"
|
||||
echo "ERROR : container ${1} exists"
|
||||
exit 1
|
||||
else
|
||||
return 0
|
||||
|
|
|
@ -7,9 +7,11 @@ source ${ABSDIR}/vars.sh
|
|||
ensure_pwd_is_scriptdir
|
||||
ensure_not_root
|
||||
|
||||
echo "Checking podman images..."
|
||||
echo "Podman images status..."
|
||||
podman images ${upstream_image}
|
||||
echo
|
||||
echo "Checking container status..."
|
||||
podman ps -a | grep ${container_name}
|
||||
echo
|
||||
echo "Checking systemd unit status..."
|
||||
systemctl --user status ${service_name}
|
||||
|
|
|
@ -10,3 +10,4 @@ ensure_not_root
|
|||
ensure_container_not_exists ${container_name}
|
||||
|
||||
podman run --name ${container_name} --user nobody -p ${listen_if}:${listen_port}:9000 -d ${upstream_image}:${upstream_version}
|
||||
podman stop ${container_name}
|
||||
|
|
|
@ -12,7 +12,8 @@ ensure_container_exists ${container_name}
|
|||
# Check of running through systemd (as it should be)
|
||||
if check_systemd_unit_exists ${service_name}; then
|
||||
if check_systemd_unit_running ${service_name}; then
|
||||
systemctl --user stop ${service_name}
|
||||
systemctl --user stop ${service_name} &&
|
||||
Systemd service ${service_name} stopped
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -7,7 +7,13 @@ source ${ABSDIR}/vars.sh
|
|||
ensure_pwd_is_scriptdir
|
||||
ensure_not_root
|
||||
|
||||
# FAIL if container does not exists
|
||||
ensure_container_exists ${container_name}
|
||||
|
||||
# FAIL if systemd unit does not exists
|
||||
ensure_systemd_unit_exists ${service_name}
|
||||
|
||||
systemctl --user --now disable ${service_name}
|
||||
# FAIL if systemd unit is running (stop it first)
|
||||
ensure_systemd_unit_not_running ${service_name}
|
||||
|
||||
systemctl --user disable ${service_name}
|
||||
|
|
|
@ -7,15 +7,15 @@ source ${ABSDIR}/vars.sh
|
|||
ensure_pwd_is_scriptdir
|
||||
ensure_not_root
|
||||
|
||||
# FAIL if container is running
|
||||
ensure_container_not_running ${container_name}
|
||||
|
||||
# FAIL if container does not exists
|
||||
ensure_container_exists ${container_name}
|
||||
|
||||
# FAIL if systemd unit is running
|
||||
ensure_systemd_unit_not_running ${service_name}
|
||||
|
||||
# FAIL if container is running
|
||||
ensure_container_not_running ${container_name}
|
||||
|
||||
rm -f ${HOME}/.config/systemd/user/${service_name}
|
||||
systemctl --user disable ${service_name}
|
||||
systemctl --user daemon-reload
|
||||
|
|
|
@ -7,10 +7,13 @@ source ${ABSDIR}/vars.sh
|
|||
ensure_pwd_is_scriptdir
|
||||
ensure_not_root
|
||||
|
||||
# FAIL if systemd unit exists
|
||||
ensure_systemd_unit_not_exists ${service_name}
|
||||
# FAIL if container is running
|
||||
ensure_container_not_running ${container_name}
|
||||
|
||||
# FAIL if container exists
|
||||
ensure_container_not_exists ${container_name}
|
||||
|
||||
podman rmi "$(podman images -a -q -- ${upstream_image})"
|
||||
# FAIL if systemd unit exists
|
||||
ensure_systemd_unit_not_exists ${service_name}
|
||||
|
||||
podman rmi "$(podman images -a -q -- ${upstream_image})" || echo 'No images to remove.'
|
||||
|
|
Loading…
Reference in a new issue