Let tincctl use the NETNAME environment variable if no -n option is given.
This allows administrators who frequently want to work with one tinc network to omit the -n option. Since the NETNAME variable is set by tincd when executing scripts, this makes it slightly easier to use tincctl from within scripts.
This commit is contained in:
parent
84570275ac
commit
344d6b9ac3
3 changed files with 24 additions and 0 deletions
|
@ -138,6 +138,12 @@ static bool parse_options(int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
|
||||
if(!netname) {
|
||||
netname = getenv("NETNAME");
|
||||
if(netname)
|
||||
netname = xstrdup(netname);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue