06.12.2012 Aufrufe

Technische Dokumentation zum Unix-Verbund ... - Dr. Hubert Feyrer

Technische Dokumentation zum Unix-Verbund ... - Dr. Hubert Feyrer

Technische Dokumentation zum Unix-Verbund ... - Dr. Hubert Feyrer

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

B.27 Monitoring/ftpd-kill.c 315<br />

veryclean: clean<br />

-rm -f nkill<br />

-rm -f ftpd-kill<br />

B.27 Monitoring/ftpd-kill.c<br />

/**************************************************************************<br />

* The contents of this file are (c) Copyright 1996 by <strong>Hubert</strong> <strong>Feyrer</strong>.<br />

* Any use of the knowledge stored in this file may not be used outside<br />

* of the Fachhochschule Regensburg without contacting me first.<br />

*************************************************************************/<br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

extern int wildmat(char *text, char *p);<br />

int debug=0;<br />

int verbose=0;<br />

int main(int argc, char *argv[])<br />

{<br />

DIR *d;<br />

int idlesecs;<br />

int maxidlesecs; /* argv[1] */<br />

char *prog2kill; /* argv[2] */<br />

time_t cur_time;<br />

struct dirent *de;<br />

int c;<br />

while((c=getopt(argc, argv, "dv")) != EOF){<br />

switch(c){<br />

case 'd':<br />

debug=1;<br />

break;<br />

case 'v':<br />

verbose++;<br />

break;<br />

}<br />

}<br />

if(argc-optind!=2){<br />

fprintf(stderr,"Usage: %s [-dv] #isecs prog\n",argv[0]);<br />

exit(1);<br />

}<br />

cur_time = time(NULL);<br />

maxidlesecs=atoi(argv[optind+0]);<br />

prog2kill=argv[optind+1];<br />

if(debug){<br />

printf("maxidlesecs=%d\n",maxidlesecs);<br />

printf("prog2kill=%s\n",prog2kill);<br />

printf("debug=%d, verbose=%d\n",debug,verbose);<br />

printf("argc=%d, optind=%d\n",argc,optind);<br />

{<br />

int i;<br />

for(i=0;i

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!