24 lines
440 B
C
24 lines
440 B
C
#include "types.h"
|
|
#include "user.h"
|
|
|
|
int main(int argc, char *argv[]) {
|
|
int restart = 0;
|
|
|
|
for (int i = 1; i < argc; i++) {
|
|
if (strcmp(argv[i], "-r") == 0) {
|
|
restart = 1;
|
|
}
|
|
}
|
|
|
|
switch(restart) {
|
|
case 0:
|
|
printf(1, "Shutting Down...\n");
|
|
break;
|
|
case 1:
|
|
printf(1, "Restarting...\n");
|
|
break;
|
|
}
|
|
|
|
shutdown(restart);
|
|
exit();
|
|
}
|