mirror of
https://codeberg.org/Mo8it/server_dotfiles.git
synced 2024-09-19 19:01:16 +00:00
Update podman-default-create
This commit is contained in:
parent
d27c1a7c2f
commit
3088533580
1 changed files with 4 additions and 13 deletions
|
@ -5,23 +5,14 @@ set -p PATH "$HOME/.cargo/bin"
|
||||||
function podman-default-create -w podman
|
function podman-default-create -w podman
|
||||||
set -l container_name $argv[1]
|
set -l container_name $argv[1]
|
||||||
|
|
||||||
if systemctl --user is-enabled container-$container_name
|
|
||||||
systemctl --user disable --now container-$container_name
|
|
||||||
end
|
|
||||||
|
|
||||||
if podman container exists $container_name
|
|
||||||
podman stop $container_name
|
|
||||||
end
|
|
||||||
|
|
||||||
podman create \
|
podman create \
|
||||||
--name $container_name \
|
--name $container_name \
|
||||||
|
--replace \
|
||||||
--tz local \
|
--tz local \
|
||||||
$argv[2..]
|
-e TZ=Europe/Berlin \
|
||||||
|
$argv[2..]; or return 1
|
||||||
|
|
||||||
set -l old_pwd (pwd)
|
podman generate systemd --no-header --new --name $container_name >~/.config/systemd/user/container-$container_name.service; or return 1
|
||||||
cd ~/.config/systemd/user
|
|
||||||
podman generate systemd --new --files --name $container_name
|
|
||||||
cd $old_pwd
|
|
||||||
|
|
||||||
systemctl --user enable --now container-$container_name
|
systemctl --user enable --now container-$container_name
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue