8 fd = open("/dev/reboot", OWRITE);
10 write(fd, "reboot", 6);
15 readenv(char *name, char *buf, int n)
23 strcat(ename, "/env/");
25 f = open(ename, OREAD);
28 n = read(f, ans, n-1);
42 if(strstr(msg, "alarm")){
50 main(int argc, char **argv)
59 strecpy(file, file+sizeof file, argv[1]);
61 p = readenv("cputype", buf, sizeof buf);
69 if (access(file, AREAD) < 0)
70 sysfatal("%s not readable: %r", file);
72 switch(rfork(RFPROC|RFNOWAIT|RFNOTEG|RFCFDG)){
80 fd = open(file, OREAD);
84 // the logic here is to make a request every 5 minutes.
85 // If the request alarms out, that's OK, the file server
86 // may just be busy. If the request fails for any other
87 // reason, it's probably because the connection went