From af6d5f438bf18c92730a8ae273efa54cd11f2906 Mon Sep 17 00:00:00 2001 From: Bjørn Mork Date: Sun, 5 Nov 2017 15:42:31 +0100 Subject: ripe-atlas-fw: imported version 4780 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bjørn Mork --- shell/hush.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'shell/hush.c') diff --git a/shell/hush.c b/shell/hush.c index d696d73..5ef39bc 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -73,6 +73,7 @@ #if ENABLE_HUSH_CASE #include #endif +#include #define HUSH_VER_STR "0.91" @@ -774,6 +775,7 @@ static int builtin_rxtxrpt(char **argv); static int builtin_rptaddrs(char **argv); static int builtin_rptuptime(char **argv); static int builtin_onlyuptime(char **argv); +static int builtin_reboot_probe(char **argv); static int builtin_true(char **argv); static int builtin_set(char **argv); static int builtin_shift(char **argv); @@ -836,6 +838,7 @@ static const struct built_in_command bltins[] = { BLTIN("rptaddrs" , builtin_rptaddrs, "report address(es), route(s), and dns"), BLTIN("rptuptime" , builtin_rptuptime, "report uptime"), BLTIN("onlyuptime" , builtin_onlyuptime, "report uptime in seconds"), + BLTIN("reboot_probe" , builtin_reboot_probe, "built-in reboot command"), 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"), @@ -4797,6 +4800,15 @@ static int builtin_onlyuptime(char **argv __attribute((unused))) return 0; } +static int builtin_reboot_probe(char **argv __attribute((unused))) +{ + int r; + + sync(); + r= reboot(RB_AUTOBOOT); + return r; +} + static int builtin_rchoose(char **argv) { int argc = 0; -- cgit v1.2.3