Commit d4240ad0 authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

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
parent 75f767ca
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment