]> git.sur5r.net Git - ngadmin/blob - cli/com_firmware.c
CLI: separated commands by category in different files.
[ngadmin] / cli / com_firmware.c
1
2 #include "commands.h"
3
4
5
6 bool do_firmware_show (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga) {
7  
8  const struct swi_attr *sa;
9  bool ret=true;
10  
11  
12  if ( (sa=ngadmin_getCurrentSwitch(nga))==NULL ) {
13   printf("must be logged\n");
14   ret=false;
15   goto end;
16  }
17  
18  puts(sa->firmware);
19  
20  
21  end:
22  
23  return ret;
24  
25 }
26
27
28
29 bool do_firmware_upgrade (int nb, const char **com UNUSED, struct ngadmin *nga) {
30  
31  const struct swi_attr *sa;
32  bool ret=true;
33  
34  
35  if ( nb!=1 ) {
36   printf("Usage: firmware upgrade <file>\n");
37   ret=false;
38  }
39  
40  if ( (sa=ngadmin_getCurrentSwitch(nga))==NULL ) {
41   printf("must be logged\n");
42   ret=false;
43   goto end;
44  }
45  
46  printf("not implemented yet\n");
47  
48  
49  end:
50  
51  return ret;
52  
53 }
54
55
56