From 0a6fcfe41f81cfa354d8b4936550f6dba64baf11 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Thu, 10 Feb 2022 21:48:57 +0100 Subject: [PATCH] peerjs : suite --- podman-peerjs/20_enable.sh | 10 +++++++--- podman-peerjs/vars.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/podman-peerjs/20_enable.sh b/podman-peerjs/20_enable.sh index 0c0c92a..3720f22 100755 --- a/podman-peerjs/20_enable.sh +++ b/podman-peerjs/20_enable.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -ABSDIR="$( dirname "$(readlink -f -- "$0")" )" +ABSDIR="$( dirname "$(realpath -s -- "$0")" )" source ${ABSDIR}/../functions.sh source ${ABSDIR}/vars.sh ensure_pwd_is_scriptdir ensure_not_root +# container should exist ensure_container_exists ${container_name} +# container should NOT be running. Installation script must have stopped it. +ensure_container_not_running ${container_name} ensure_systemd_as_user_dir_exists -podman generate systemd --name ${container_name} > ${HOME}/.config/systemd/user/${service_name} -podman stop ${container_name} +podman generate systemd --files --name ${container_name} +mv *.service ~/.config/systemd/user/ + systemctl --user enable ${service_name} diff --git a/podman-peerjs/vars.sh b/podman-peerjs/vars.sh index 642d146..67cf7a9 100644 --- a/podman-peerjs/vars.sh +++ b/podman-peerjs/vars.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash container_name='peerjs-server' -service_name="container_${container_name}.service" +service_name="container-${container_name}.service" listen_if='127.0.0.1' listen_port='9000' upstream_images='docker.io/peerjs/peerjs-server'