services-garbaye/podman-peerjs/20_enable.sh

21 lines
530 B
Bash
Raw Normal View History

2021-05-04 20:14:08 +00:00
#!/usr/bin/env bash
2022-02-10 20:48:57 +00:00
ABSDIR="$( dirname "$(realpath -s -- "$0")" )"
2021-05-04 20:14:08 +00:00
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
2022-02-10 20:48:57 +00:00
# container should exist
ensure_container_exists ${container_name}
2022-02-10 20:48:57 +00:00
# container should NOT be running. Installation script must have stopped it.
ensure_container_not_running ${container_name}
2021-05-04 20:14:08 +00:00
ensure_systemd_as_user_dir_exists
2022-02-10 20:48:57 +00:00
podman generate systemd --files --name ${container_name}
mv *.service ~/.config/systemd/user/
systemctl --user enable ${service_name}