2022-02-10 21:10:02 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
ABSDIR="$( dirname "$(realpath -s -- "$0")" )"
|
2023-07-29 14:48:12 +00:00
|
|
|
source "${ABSDIR}"/../functions.sh
|
|
|
|
source "${ABSDIR}"/vars.sh
|
2022-02-10 21:10:02 +00:00
|
|
|
|
|
|
|
ensure_pwd_is_scriptdir
|
|
|
|
ensure_not_root
|
|
|
|
|
|
|
|
# container should exist
|
2023-07-29 14:48:12 +00:00
|
|
|
ensure_container_exists "${container_name}"
|
2022-02-10 21:10:02 +00:00
|
|
|
# container should NOT be running. Installation script must have stopped it.
|
2023-07-29 14:48:12 +00:00
|
|
|
ensure_container_not_running "${container_name}"
|
2022-02-10 21:10:02 +00:00
|
|
|
|
|
|
|
ensure_systemd_as_user_dir_exists
|
|
|
|
|
2023-07-29 14:48:12 +00:00
|
|
|
podman generate systemd --stop-timeout=30 --files --name "${container_name}"
|
|
|
|
mv -- *.service ~/.config/systemd/user/
|
2022-02-10 21:10:02 +00:00
|
|
|
|
2022-02-12 12:59:57 +00:00
|
|
|
systemctl --user daemon-reload
|
2023-07-29 14:48:12 +00:00
|
|
|
systemctl --user enable "${service_name}"
|