#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#define TRUE 0
()
{
FILE *fp;
system("rmdir ./www.cs.rmit.edu.");
char chk[1];
strcpy(chk,"n");
  while(1)
  {
       
   	system("wget -p http://www.cs.rmit.edu./students/");
		
		system("md5sum ./www.cs.rmit.edu./images/*.* > ./www.cs.rmit.edu./text1.txt");
		
		
		if (strcmp(chk,"n")==0)		
		{		
		system("mv ./www.cs.rmit.edu./text1.txt   ./text2.txt");
		system("mkdir ./");
		
		system("mv ./www.cs.rmit.edu./students/index.html ./");
		}
		else
		{
		
		
		system(" diff ./www.cs.rmit.edu./students/index.html .//index.html | mail @cs.rmit.edu. ");
		system(" diff ./www.cs.rmit.edu./text1.txt ./text2.txt | mail @cs.rmit.edu. ");
		system("mv ./www.cs.rmit.edu./students/index.html ./");
		system("mv ./www.cs.rmit.edu./text1.txt   ./text2.txt");				
		}
		sleep(86400);
		strcpy(chk,"y");
		
	}
}		    	      
      
      

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <strings.h>
#include <ctype.h>

int ()
{
  FILE *open;
  
  char *tst,check[5];
    
  system("wget -p --convert-links http://www.cs.rmit.edu./students/");
  system("mkdir one");
  
  system("mv www.cs.rmit.edu./images/*.*  one/");
  system("mv www.cs.rmit.edu./students/*.* one/");
  
  sleep(90);

  system("wget -p --convert-links http://www.cs.rmit.edu./students/");
  
  system("mkdir two");
  
  system("mv www.cs.rmit.edu./images/*.* two/");
  system("mv www.cs.rmit.edu./students/*.* two/");
  
  system("diff one two > imagedif.txt");
  
  open = fopen("imagedif.txt","r");
  tst = fgets(check, 5, open);
  
  if (strlen(check) != 0)
     
	  system("mailx -s  \" WatchDog Difference \" @.rmit.edu. < imagedif.txt");
  
  return 0;
  system("rm -r one");
  system ("rm -r two");
}
