Don't ask questions if we are not running interactively.
authorGuus Sliepen <guus@tinc-vpn.org>
Wed, 29 Jan 2014 16:17:59 +0000 (17:17 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Wed, 29 Jan 2014 16:17:59 +0000 (17:17 +0100)
commit2e318f379992a730f592b4c5261d26d8e1a38cfd
treec6545cc33a04c8cbb00ab629b106b7f585769275
parent00398a60ec317740bcec83c5a524c5a95ce7f1c2
Don't ask questions if we are not running interactively.

When creating invitations or using them to join a VPN, and the tinc command is
not run interactively (ie, when stdin and stdout are not connected or
redirected to/from a file), don't ask questions. If normally tinc would ask for
a confirmation, just assume the default answer instead. If tinc really needs
some input, just print an error message instead.

In case an invitation is used for a VPN which uses a netname that is already in
use on the local host, tinc will store the configuration in a temporary
directory. Normally it asks for an alternative netname and then renames the
temporary directory, but when not run interactively, it now just prints the
location of the unchanged temporary directory.
src/invitation.c
src/tincctl.c