]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/setup/misc.c
1 /* SmoothWall setup program.
3 * This program is distributed under the terms of the GNU General Public
4 * Licence. See the file COPYING for details.
6 * (c) Lawrence Manning, 2001
7 * Misc. stuff for the lib.
13 #define _(x) dgettext("setup", x)
22 int writehostsfiles(void)
26 char hostname
[STRING_SIZE
];
27 char domainname
[STRING_SIZE
] = "localdomain";
28 char commandstring
[STRING_SIZE
];
31 if (!(readkeyvalues(kv
, CONFIG_ROOT
"/main/settings")))
34 errorbox(_("Unable to open settings file"));
37 strcpy(hostname
, SNAME
);
38 findkey(kv
, "HOSTNAME", hostname
);
39 findkey(kv
, "DOMAINNAME", domainname
);
42 sprintf(commandstring
, "/bin/hostname %s.%s", hostname
, domainname
);
43 if (mysystem(NULL
, commandstring
))
45 errorbox(_("Unable to set hostname."));