diff expire.c @ 3:5a977ccbc7a9 default tip

Empty changelog
author darius
date Sat, 06 Dec 1997 05:41:29 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/expire.c	Sat Dec 06 05:41:29 1997 +0000
@@ -0,0 +1,45 @@
+/* $Id: expire.c,v 1.1.1.1 1997/12/06 05:41:29 darius Exp $ */
+
+#ifndef hpux
+#include <sys/time.h>
+#endif
+#include <time.h>
+#include <stdio.h>
+
+
+/* Here's a handy perl script to set any timeout you want:
+
+   perl -e 'require "timelocal.pl"; print &timelocal(0,0,0,9,9,93);'
+
+   The arguments to timelocal are (sec, min, hours, mday, mon, year).
+   These are all 0 based indexing so the 7th day of the month is
+   really 6 to the perl script.
+   */
+
+static time_t expire = 915091200;
+
+void 
+checkExpire(verbose)
+    int     verbose;
+{
+    time_t  now;
+
+    now = time(NULL);
+    if (verbose) {
+	printf("This client expires on %s\n", ctime(&expire));
+	return;
+    }
+    if (now > expire) {
+	printf("\
+  I'm sorry.  This client has expired.  You may bypass the expire by\n\
+using the -o option which disables RSA authentication.  Expired\n\
+clients are not supported by paradise-workers.\n\
+  You can find a new set of binaries on ftp.pnetrek.org OR ftp.cs.umn.edu \n\
+in the directory /users/glamm/paradise/bin/.  If you have any problems mail \n\
+to paradise-workers@pnetrek.org\n");
+	exit(0);
+
+    } else if (now + 10 * 24 * 60 * 60 > expire) {
+	printf("This client expires in %d days.\n", (int) (expire - now) / (60 * 60 * 24));
+    }
+}