X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Fmisc-progs%2Fsmartctrl.c;fp=src%2Fmisc-progs%2Fsmartctrl.c;h=b3a40629bcf94ad61fe761dcf3522b550d73c9a5;hp=0000000000000000000000000000000000000000;hb=40b0879d8fc50864d5a5aec242ac1143ba05fa1a;hpb=72fe12a934084f7127b252bdfa3ab6d24e0bf5cb diff --git a/src/misc-progs/smartctrl.c b/src/misc-progs/smartctrl.c new file mode 100644 index 0000000000..b3a40629bc --- /dev/null +++ b/src/misc-progs/smartctrl.c @@ -0,0 +1,28 @@ +/* This file is part of the IPFire Firewall. + * + * This program is distributed under the terms of the GNU General Public + * Licence. See the file COPYING for details. + * + */ + +#include +#include +#include +#include +#include +#include +#include "setuid.h" + +int main(int argc, char *argv[]) { + + if (!(initsetuid())) + exit(1); + + if (argc < 2) { + fprintf(stderr, "\nNo argument given.\n\nsmartctrl \n\n"); + exit(1); + } + safe_system("smartctl -iHA /dev/%s", argv[1]); + + return 0; +}