From e657eb874cab9a39ec2310d6b478526bb5206e94 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 6 Aug 2014 14:11:57 +0200 Subject: show banner in relation to start time --- nullshell.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nullshell.c b/nullshell.c index 0b24ef0..7422b4a 100644 --- a/nullshell.c +++ b/nullshell.c @@ -8,6 +8,7 @@ * by Mario A. Valdez-Ramirez (http://www.mariovaldez.net/) */ +#include #include #include #include @@ -26,9 +27,14 @@ void sig_callback(int signal) { int main(int argc, char **argv) { time_t now; + uint8_t start; char *ssh_connection, *ssh_client, *ssh_tty; char * string = BANNER; + /* get the start time and calculate modulo */ + time(&now); + start = (now / 30) % 30; + /* read environment variables */ ssh_connection = getenv("SSH_CONNECTION"); ssh_client = getenv("SSH_CLIENT"); @@ -57,7 +63,7 @@ int main(int argc, char **argv) { fflush(NULL); if (*string == 0) { time(&now); - if ((now / 30) % 30 > 0) + if ((now / 30) % 30 != start) string = ctime(&now); else string = BANNER; -- cgit v1.2.3-70-g09d2