aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nullshell.c8
1 files changed, 7 insertions, 1 deletions
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 <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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;