Lines Matching refs:hostname
0 /* hostname.c - Get/Set the hostname
5 * http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/hostname.html
7 USE_HOSTNAME(NEWTOY(hostname, ">1bdsfF:[!bdsf]", TOYFLAG_BIN))
11 bool "hostname"
14 usage: hostname [-bdsf] [-F FILENAME] [newname]
16 Get/set the current hostname.
18 -b Set hostname to 'localhost' if otherwise unset
21 -F Set hostname to contents of FILENAME
30 Show domain this system belongs to (same as hostname -d).
43 char *hostname = toybuf, *dot;
47 if (TT.F && (hostname = xreadfile(TT.F, 0, 0))) {
48 if (!*chomp(hostname)) {
49 if (CFG_TOYBOX_FREE) free(hostname);
51 hostname = 0;
53 } else hostname = (FLAG(b) && !*toybuf) ? "localhost" : *toys.optargs;
56 if (hostname) {
57 if (sethostname(hostname, strlen(hostname)))
58 perror_exit("set '%s'", hostname);