mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 09:56:51 +03:00
systemctl: check existence of all units, not just the first one
This commit is contained in:
parent
7a0019d373
commit
f8d6cb48a3
@ -6201,11 +6201,15 @@ static int enable_unit(int argc, char *argv[], void *userdata) {
|
|||||||
sd_bus *bus;
|
sd_bus *bus;
|
||||||
|
|
||||||
if (STR_IN_SET(verb, "mask", "unmask")) {
|
if (STR_IN_SET(verb, "mask", "unmask")) {
|
||||||
r = unit_exists(*names);
|
char **name;
|
||||||
if (r < 0)
|
|
||||||
return r;
|
STRV_FOREACH(name, names) {
|
||||||
if (r == 0)
|
r = unit_exists(*name);
|
||||||
log_notice("Unit %s does not exist, proceeding anyway.", *names);
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
if (r == 0)
|
||||||
|
log_notice("Unit %s does not exist, proceeding anyway.", *names);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r = acquire_bus(BUS_MANAGER, &bus);
|
r = acquire_bus(BUS_MANAGER, &bus);
|
||||||
|
Loading…
Reference in New Issue
Block a user