]>
git.ipfire.org Git - people/pmueller/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 int main(int argc
, char *argv
[]) {
21 fprintf(stderr
, "\nNo argument given.\n\nsmartctrl <device>\n\n");
25 char command
[STRING_SIZE
];
26 snprintf(command
, STRING_SIZE
, "/var/run/hddshutdown-%s", argv
[1]);
28 FILE *fp
= fopen(command
, "r");
32 printf("\nDisk %s is in Standby. Do nothing because we won't wakeup\n",argv
[1]);
36 snprintf(command
, STRING_SIZE
, "smartctl -iHA /dev/%s", argv
[1]);