[BusyBox] busybox hostname

Orion Poplawski OPoplawski at cqg.com
Wed Oct 11 22:01:34 UTC 2000


busybox 0.47 hostname is incompatible with lrp 2.9.8's /etc/init.d/hostname
which uses the --file option.  Below are some patches to add the --file
option to busybox.  There doesn't appear to be a consistent method of
argument handling, so this is just what I came up with.

Other option is to use the -F option in /etc/init.d/hostname.

Finally, busybox doesn't have "dnsdomainname -> hostname -d", but it doesn't
look like LRP uses it (though it does have the link).

Hope someone finds this usefull.

- Orion


*** busybox-0.47/hostname.c     Mon Sep 25 15:45:57 2000
--- busybox-0.47.new/hostname.c Wed Oct 11 15:40:49 2000
***************
*** 93,98 ****
--- 93,104 ----
                                }
                                filename = *(++argv);
                                break;
+                       case '-':
+                               if (strcmp(++(*argv), "file") || --argc ==
0) {
+                                       usage(hostname_usage);
+                               }
+                               filename = *(++argv);
+                               break;
                        default:
                                usage(hostname_usage);
                        }



*** busybox-0.47/usage.c        Mon Sep 25 15:42:28 2000
--- busybox-0.47.new/usage.c    Wed Oct 11 15:37:32 2000
***************
*** 449,455 ****

        "\t-i\t\tAddresses for the hostname\n"
        "\t-d\t\tDNS domain name\n"
!       "\t-F FILE\t\tUse the contents of FILE to specify the hostname\n"
  #endif
        ;
  #endif
--- 449,455 ----

        "\t-i\t\tAddresses for the hostname\n"
        "\t-d\t\tDNS domain name\n"
!       "\t-F, --file FILE\t\tUse the contents of FILE to specify the
hostname\n"
  #endif
        ;
  #endif


-----------------------------------------------------------------------
Orion Poplawski, OPoplawski at cqg.com, Tel: (303) 440-4462x17, Fax: -4507
CQG, Inc., 250 Arapahoe Avenue, Boulder, CO 80302







More information about the busybox mailing list