diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-08-21 22:46:33 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-08-21 22:46:33 +0000 |
commit | 918507eddaa70b3f75196802b8f905f97bd5f5b6 (patch) | |
tree | 83f5bff33a0bb5d9087fdb64ea4e8da3d5e138db | |
parent | 851ce895bdf33b95ccbfc67061f8949e36fad196 (diff) | |
download | busybox-w32-918507eddaa70b3f75196802b8f905f97bd5f5b6.tar.gz busybox-w32-918507eddaa70b3f75196802b8f905f97bd5f5b6.tar.bz2 busybox-w32-918507eddaa70b3f75196802b8f905f97bd5f5b6.zip |
Added the 'rdate' command, thanks to Sterling Huxley <sterling@europa.com>.
I added the docs, and made behavior identical to the GNU version.
-Erik
-rw-r--r-- | Changelog | 2 | ||||
-rw-r--r-- | applets/busybox.c | 3 | ||||
-rw-r--r-- | applets/usage.c | 12 | ||||
-rw-r--r-- | busybox.c | 3 | ||||
-rw-r--r-- | busybox.def.h | 1 | ||||
-rw-r--r-- | docs/busybox.pod | 17 | ||||
-rw-r--r-- | docs/busybox.sgml | 23 | ||||
-rw-r--r-- | internal.h | 2 | ||||
-rw-r--r-- | usage.c | 12 |
9 files changed, 73 insertions, 2 deletions
@@ -12,6 +12,8 @@ | |||
12 | * Add optional ls file sorting, thanks to a patch from | 12 | * Add optional ls file sorting, thanks to a patch from |
13 | Sterling Huxley <sterling@europa.com> | 13 | Sterling Huxley <sterling@europa.com> |
14 | * lsmod now uses the query_module syscall, rather then /proc | 14 | * lsmod now uses the query_module syscall, rather then /proc |
15 | * Added 'rdate' command from Sterling Huxley <sterling@europa.com> | ||
16 | * Added 'getopt' command from "Alfred M. Szmidt" <ams@trillian.itslinux.org> | ||
15 | 17 | ||
16 | 18 | ||
17 | -Erik Andersen | 19 | -Erik Andersen |
diff --git a/applets/busybox.c b/applets/busybox.c index d93fc5185..d4fbb8990 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
@@ -226,6 +226,9 @@ const struct BB_applet applets[] = { | |||
226 | #ifdef BB_PWD | 226 | #ifdef BB_PWD |
227 | {"pwd", pwd_main, _BB_DIR_BIN, pwd_usage}, | 227 | {"pwd", pwd_main, _BB_DIR_BIN, pwd_usage}, |
228 | #endif | 228 | #endif |
229 | #ifdef BB_RDATE | ||
230 | {"rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage}, | ||
231 | #endif | ||
229 | #ifdef BB_REBOOT | 232 | #ifdef BB_REBOOT |
230 | {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage}, | 233 | {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage}, |
231 | #endif | 234 | #endif |
diff --git a/applets/usage.c b/applets/usage.c index eaa77cc84..7cd05c8f2 100644 --- a/applets/usage.c +++ b/applets/usage.c | |||
@@ -855,6 +855,18 @@ const char pwd_usage[] = | |||
855 | ; | 855 | ; |
856 | #endif | 856 | #endif |
857 | 857 | ||
858 | #if defined BB_RDATE | ||
859 | const char rdate_usage[] = | ||
860 | "rdate [OPTION] HOST\n" | ||
861 | #ifndef BB_FEATURE_TRIVIAL_HELP | ||
862 | "\nGet and possibly set the system date and time from a remote HOST.\n" | ||
863 | "Options:\n" | ||
864 | "\t-s\tSet the system date and time (default).\n" | ||
865 | "\t-p\tPrint the date and time.\n" | ||
866 | #endif | ||
867 | ; | ||
868 | #endif | ||
869 | |||
858 | #if defined BB_REBOOT | 870 | #if defined BB_REBOOT |
859 | const char reboot_usage[] = | 871 | const char reboot_usage[] = |
860 | "reboot\n" | 872 | "reboot\n" |
@@ -226,6 +226,9 @@ const struct BB_applet applets[] = { | |||
226 | #ifdef BB_PWD | 226 | #ifdef BB_PWD |
227 | {"pwd", pwd_main, _BB_DIR_BIN, pwd_usage}, | 227 | {"pwd", pwd_main, _BB_DIR_BIN, pwd_usage}, |
228 | #endif | 228 | #endif |
229 | #ifdef BB_RDATE | ||
230 | {"rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage}, | ||
231 | #endif | ||
229 | #ifdef BB_REBOOT | 232 | #ifdef BB_REBOOT |
230 | {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage}, | 233 | {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage}, |
231 | #endif | 234 | #endif |
diff --git a/busybox.def.h b/busybox.def.h index 692c7213f..63b8306f3 100644 --- a/busybox.def.h +++ b/busybox.def.h | |||
@@ -73,6 +73,7 @@ | |||
73 | #define BB_PRINTF | 73 | #define BB_PRINTF |
74 | #define BB_PS | 74 | #define BB_PS |
75 | #define BB_PWD | 75 | #define BB_PWD |
76 | #define BB_RDATE | ||
76 | #define BB_REBOOT | 77 | #define BB_REBOOT |
77 | #define BB_RENICE | 78 | #define BB_RENICE |
78 | #define BB_RESET | 79 | #define BB_RESET |
diff --git a/docs/busybox.pod b/docs/busybox.pod index 4fba7eafa..a2d4e02bd 100644 --- a/docs/busybox.pod +++ b/docs/busybox.pod | |||
@@ -61,7 +61,7 @@ fdflush, find, free, freeramdisk, fsck.minix, getopt, grep, gunzip, gzip, halt, | |||
61 | head, hostid, hostname, id, init, insmod, kill, killall, length, ln, | 61 | head, hostid, hostname, id, init, insmod, kill, killall, length, ln, |
62 | loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, makedevs, mkdir, | 62 | loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, makedevs, mkdir, |
63 | mkfifo, mkfs.minix, mknod, mkswap, mktemp, more, mount, mt, mv, nc, | 63 | mkfifo, mkfs.minix, mknod, mkswap, mktemp, more, mount, mt, mv, nc, |
64 | nslookup, ping, poweroff, printf, ps, pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, | 64 | nslookup, ping, poweroff, printf, ps, pwd, rdate, reboot, renice, reset, rm, rmdir, rmmod, sed, |
65 | setkeycodes, sh, sleep, sort, swapoff, swapon, sync, syslogd, tail, | 65 | setkeycodes, sh, sleep, sort, swapoff, swapon, sync, syslogd, tail, |
66 | tar, tee, telnet, test, touch, tr, true, tty, umount, uname, uniq, update, | 66 | tar, tee, telnet, test, touch, tr, true, tty, umount, uname, uniq, update, |
67 | uptime, usleep, uudecode, uuencode, wc, which, whoami, yes, zcat, [ | 67 | uptime, usleep, uudecode, uuencode, wc, which, whoami, yes, zcat, [ |
@@ -1422,6 +1422,19 @@ Example: | |||
1422 | 1422 | ||
1423 | ------------------------------- | 1423 | ------------------------------- |
1424 | 1424 | ||
1425 | =item rdate | ||
1426 | |||
1427 | Usage: rdate [OPTION] HOST | ||
1428 | |||
1429 | Get and possibly set the system date and time from a remote HOST. | ||
1430 | |||
1431 | Options: | ||
1432 | |||
1433 | -s Set the system date and time (default). | ||
1434 | -p Print the date and time. | ||
1435 | |||
1436 | ------------------------------- | ||
1437 | |||
1425 | =item reboot | 1438 | =item reboot |
1426 | 1439 | ||
1427 | Instructs the kernel to reboot the system. | 1440 | Instructs the kernel to reboot the system. |
@@ -2094,4 +2107,4 @@ Enrique Zanardi <ezanardi@ull.es> | |||
2094 | 2107 | ||
2095 | =cut | 2108 | =cut |
2096 | 2109 | ||
2097 | # $Id: busybox.pod,v 1.62 2000/08/21 22:02:34 andersen Exp $ | 2110 | # $Id: busybox.pod,v 1.63 2000/08/21 22:46:33 andersen Exp $ |
diff --git a/docs/busybox.sgml b/docs/busybox.sgml index f53be8d6f..d590237bf 100644 --- a/docs/busybox.sgml +++ b/docs/busybox.sgml | |||
@@ -2488,6 +2488,29 @@ | |||
2488 | </para> | 2488 | </para> |
2489 | </sect1> | 2489 | </sect1> |
2490 | 2490 | ||
2491 | <sect1 id="rdate"> | ||
2492 | <title>rdate</title> | ||
2493 | |||
2494 | <para> | ||
2495 | Usage: rdate [OPTION] HOST | ||
2496 | </para> | ||
2497 | |||
2498 | <para> | ||
2499 | Get and possibly set the system date and time from a remote HOST. | ||
2500 | </para> | ||
2501 | |||
2502 | <para> | ||
2503 | Options: | ||
2504 | </para> | ||
2505 | |||
2506 | <para> | ||
2507 | <screen> | ||
2508 | -s Set the system date and time (default). | ||
2509 | -p Print the date and time. | ||
2510 | </screen> | ||
2511 | </para> | ||
2512 | </sect1> | ||
2513 | |||
2491 | <sect1 id="reboot"> | 2514 | <sect1 id="reboot"> |
2492 | <title>reboot</title> | 2515 | <title>reboot</title> |
2493 | 2516 | ||
diff --git a/internal.h b/internal.h index 939384c42..ab0d94fb8 100644 --- a/internal.h +++ b/internal.h | |||
@@ -177,6 +177,7 @@ extern int poweroff_main(int argc, char **argv); | |||
177 | extern int printf_main(int argc, char** argv); | 177 | extern int printf_main(int argc, char** argv); |
178 | extern int ps_main(int argc, char** argv); | 178 | extern int ps_main(int argc, char** argv); |
179 | extern int pwd_main(int argc, char** argv); | 179 | extern int pwd_main(int argc, char** argv); |
180 | extern int rdate_main(int argc, char** argv); | ||
180 | extern int reboot_main(int argc, char** argv); | 181 | extern int reboot_main(int argc, char** argv); |
181 | extern int renice_main(int argc, char** argv); | 182 | extern int renice_main(int argc, char** argv); |
182 | extern int reset_main(int argc, char** argv); | 183 | extern int reset_main(int argc, char** argv); |
@@ -283,6 +284,7 @@ extern const char poweroff_usage[]; | |||
283 | extern const char printf_usage[]; | 284 | extern const char printf_usage[]; |
284 | extern const char ps_usage[]; | 285 | extern const char ps_usage[]; |
285 | extern const char pwd_usage[]; | 286 | extern const char pwd_usage[]; |
287 | extern const char rdate_usage[]; | ||
286 | extern const char reboot_usage[]; | 288 | extern const char reboot_usage[]; |
287 | extern const char renice_usage[]; | 289 | extern const char renice_usage[]; |
288 | extern const char reset_usage[]; | 290 | extern const char reset_usage[]; |
@@ -855,6 +855,18 @@ const char pwd_usage[] = | |||
855 | ; | 855 | ; |
856 | #endif | 856 | #endif |
857 | 857 | ||
858 | #if defined BB_RDATE | ||
859 | const char rdate_usage[] = | ||
860 | "rdate [OPTION] HOST\n" | ||
861 | #ifndef BB_FEATURE_TRIVIAL_HELP | ||
862 | "\nGet and possibly set the system date and time from a remote HOST.\n" | ||
863 | "Options:\n" | ||
864 | "\t-s\tSet the system date and time (default).\n" | ||
865 | "\t-p\tPrint the date and time.\n" | ||
866 | #endif | ||
867 | ; | ||
868 | #endif | ||
869 | |||
858 | #if defined BB_REBOOT | 870 | #if defined BB_REBOOT |
859 | const char reboot_usage[] = | 871 | const char reboot_usage[] = |
860 | "reboot\n" | 872 | "reboot\n" |