blob: 62bea5bc12de9925ed3bc6363ce4e901115d9e7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/sbin/openrc-run
# Copyright 2015-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
description="Start all containers with restart-policy set to always or unless-stopped"
command_user="${RUN_AS_USER:=root:root}"
command="/usr/bin/podman"
command_args="--log-level ${LOG_LEVEL:=info} start --all --filter restart-policy=always --filter restart-policy=unless-stopped"
depend() {
after net
}
stop() {
ebegin "Stopping all containers with restart-policy set to always or unless-stopped"
${command} \
--log-level ${LOG_LEVEL} \
stop \
$(${command} container ls --filter restart-policy=always --filter restart-policy=unless-stopped -q)
eend $? "Failed to stop containers with restart-policy set to always or unless-stopped"
}
|