Re: Kernel Version and System Up-Time

2001-08-25 Thread Alexander Skwar

So sprach »Ryan Cook« am 2001-08-25 um 06:54:17 -0700 :
 On Sat, Aug 25, 2001 at 11:30:50AM +0200, Alexander Skwar wrote:
  Uptime: 0 hours 54 minutes
 
 What I'd like to know is how folks output their kernel version and
 system uptime in their .sig?

Dunno how folks do this :), but I do this like follows.  In my muttrc,
I've set:

set   signature=~/bin/signature.sh ~/.signature|

~/bin/signature.sh looks like this:

#!/bin/sh

SIG=$1

echo -e $(cat ${SIG})\\n\\t\\t$(linux_logo -g -a -F '#U'|sed 's| *\(Uptime\)|\1:|')

linux_logo -g -a -F '#U' prints:

   Uptime 5 hours 37 minutes

You can also use uptime with some clever regexp.

Now, for MUAs which do not support the signature to be the output of
some program, you can create a cron job which runs every minute and
writes a new .signature every time

For my header entry, I've got:

my_hdr X-Operating-System: An `uname -m` `uname -s` with Kernel v`uname -r`

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 5 hours 36 minutes



Re: Kernel Version and System Up-Time

2001-08-25 Thread Rich Lafferty

On Sat, Aug 25, 2001 at 06:54:17AM -0700, Ryan Cook ([EMAIL PROTECTED]) wrote:
 On Sat, Aug 25, 2001 at 11:30:50AM +0200, Alexander Skwar wrote:
  Uptime: 0 hours 54 minutes
 
 What I'd like to know is how folks output their kernel version and
 system uptime in their .sig?

What I'd like to know is why :-)

  -Rich

-- 
Rich Lafferty --+---
 Montreal, Quebec, Canada   |  Save the Pacific Northwest Tree Octopus!
 http://www.lafferty.ca/|http://zapatopi.net/treeoctopus.html
[EMAIL PROTECTED] ---+---



Re: Kernel Version and System Up-Time

2001-08-25 Thread Rainer Wiener

On Sat, 25 Aug 2001, Alexander Skwar wrote:

 
 You can also use uptime with some clever regexp.

This is a little c programm thats reads the /proc/uptime out. You can
change the output by your self.

If you make the following batch file:

#!/bin/sh
uname -r #for the kernel version
/usr/local/bin/siguptime #for the uptime


And in you .muttrc this:

set signature=/usr/local/bin/sig|

cu
Rainer
-- 
You have a deep interest in all that is artistic.


#include stdio.h

#define uptime_file  /proc/uptime


int read_uptime(float *uptime);



int main(void)
{
  float *uptime;
  int day;
  int hour;
  int min;


  *uptime = 1;
  
  if (read_uptime(uptime))
exit(1);

  day = *uptime / 86400;
  hour = *uptime / 3600;
  min = *uptime / 60 - hour * 60;

  if (day)
printf(%dd, day);
  printf(%2.d:%d\n, hour,min);
  return 0;
}


int read_uptime(float *uptime)
{
  FILE *pfile;
  int uptime_error = 0;

  if (!(pfile = fopen(uptime_file,r)))
uptime_error = 1;
  else
{
  fscanf(pfile,%f, uptime);
  fclose(pfile);
}
  return uptime_error;
}

 PGP signature


Re: Kernel Version and System Up-Time

2001-08-25 Thread Alexander Skwar

So sprach »Rich Lafferty« am 2001-08-25 um 12:01:07 -0400 :
 What I'd like to know is why :-)

To get the 4 lines full :)

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 8 hours 11 minutes