]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/misc-progs/smartctrl.c
1 /* This file is part of the IPFire Firewall.
3 * This program is distributed under the terms of the GNU General Public
4 * Licence. See the file COPYING for details.
12 #include <sys/types.h>
16 #define BUFFER_SIZE 1024
18 char command
[BUFFER_SIZE
];
20 int main(int argc
, char *argv
[]) {
26 fprintf(stderr
, "\nNo argument given.\n\nsmartctrl <device>\n\n");
31 sprintf(command
, "/tmp/hddshutdown-%s", argv
[1]);
32 FILE *fp
= fopen(command
,"r");
35 printf("\nDisk %s is in Standby. Do nothing because we won't wakeup\n",argv
[1]);
39 sprintf(command
, "smartctl -iHA -d ata /dev/%s", argv
[1]);