Initial Upload
This commit is contained in:
24
shutdown.c
Normal file
24
shutdown.c
Normal file
@ -0,0 +1,24 @@
|
||||
#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();
|
||||
}
|
Reference in New Issue
Block a user