mgenmid: add option -d for custom domain

pull/209/head
Arav K 3 years ago
parent 6684f74f07
commit 1fa062532f
No known key found for this signature in database
GPG Key ID: 6D535EE45306731D

@ -29,17 +29,26 @@ printb36(uint64_t x)
fputs(o, stdout);
}
int main()
int main(int argc, char *argv[])
{
char hostbuf[1024];
char *host = 0;
int c;
while ((c = getopt(argc, argv, "d:")) != -1)
switch (c) {
case 'd': host = optarg; break;
default:
fprintf(stderr, "Usage: mgenmid [-d domain]\n");
exit(1);
}
char *f = blaze822_home_file("profile");
struct message *config = blaze822(f);
xpledge("stdio rpath dns", "");
if (config) // try FQDN: first
if (!host && config) // try FQDN:
host = blaze822_hdr(config, "fqdn");
if (!host && gethostname(hostbuf, sizeof hostbuf) == 0) {

Loading…
Cancel
Save