mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 18:08:05 +02:00
cli: Abort when given name of a non-existent connection for nmcli up
Even when ifname is present: nmcli c up name Nonexistent ifname wlan0
This commit is contained in:
parent
75f767ca23
commit
d4240ad04c
1 changed files with 7 additions and 1 deletions
|
|
@ -2224,8 +2224,14 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
|
|||
next_arg (&argc, &argv);
|
||||
}
|
||||
|
||||
if (name)
|
||||
if (name) {
|
||||
connection = nmc_find_connection (nmc->connections, selector, name, NULL);
|
||||
if (!connection) {
|
||||
g_string_printf (nmc->return_text, _("Error: Connection '%s' does not exist."), name);
|
||||
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
while (argc > 0) {
|
||||
if (strcmp (*argv, "ifname") == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue