aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 10cab48..54d0c55 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -771,6 +771,7 @@ static int builtin_condmv(char **argv);
static int builtin_dfrm(char **argv);
static int builtin_rxtxrpt(char **argv);
static int builtin_rptaddrs(char **argv);
+static int builtin_rptuptime(char **argv);
static int builtin_true(char **argv);
static int builtin_set(char **argv);
static int builtin_shift(char **argv);
@@ -831,6 +832,7 @@ static const struct built_in_command bltins[] = {
BLTIN("dfrm" , builtin_dfrm, "cleanup if free space gets too low"),
BLTIN("rxtxrpt" , builtin_rxtxrpt, "report RX and TX"),
BLTIN("rptaddrs" , builtin_rptaddrs, "report address(es), route(s), and dns"),
+ BLTIN("rptuptime" , builtin_rptuptime, "report uptime"),
BLTIN("echo" , builtin_echo, "Write to stdout"),
BLTIN("eval" , builtin_eval, "Construct and run shell command"),
BLTIN("exec" , builtin_exec, "Execute command, don't return to shell"),
@@ -4682,7 +4684,7 @@ static int builtin_rxtxrpt(char **argv)
return rxtxrpt_main(argc, argv);
}
-int builitin_rptaddrs(int argc, char *argv[]);
+int rptaddrs_main(int argc, char *argv[]);
static int builtin_rptaddrs(char **argv)
{
@@ -4693,6 +4695,20 @@ static int builtin_rptaddrs(char **argv)
return rptaddrs_main(argc, argv);
}
+#define DBQ(str) "\"" #str "\""
+static int builtin_rptuptime(char **argv __attribute((unused)))
+{
+ struct sysinfo info;
+
+ printf("RESULT { " DBQ(id) ": " DBQ(7001) ", ");
+ printf(DBQ(fw) ": %d, ", get_atlas_fw_version());
+ printf(DBQ(time) ": %ld, ", (long)time(NULL));
+ printf(DBQ(lts) ": %d, ", get_timesync());
+ sysinfo(&info);
+ printf(DBQ(uptime) ": %ld }\n", (long)info.uptime);
+
+ return 0;
+}
static int builtin_rchoose(char **argv)
{