summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index e186215..3bf2e5a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,6 +20,8 @@
#include <shell.h>
#include <users.h>
+#include <power_commands.h>
+#include <sd_bus.h>
char *progname; /* The name of this program, as taken from argv[0]. */
int done; /* When non-zero, this global means the user is done using this program. */
@@ -31,15 +33,18 @@ static sigset_t blockmask;
COMMAND top_admin_list[] = {
{ "help", com_help, "Display this text" },
{ "?", com_help, "Synonym for `help'" },
+ { "server", com_server, "Server commands" },
{ "shell", com_shell, "Activate submenu shell" },
{ "users", com_users, "Activate submenu users" },
{ "quit", com_quit, "Quit using SILA Shell" },
+
{ (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
};
COMMAND top_operator_list[] = {
{ "help", com_help, "Display this text" },
{ "?", com_help, "Synonym for `help'" },
+ { "server", com_server, "Server commands" },
{ "shell", com_shell, "Activate submenu shell" },
{ "users", com_users, "Activate submenu users" },
{ "quit", com_quit, "Quit using SILA Shell" },
@@ -49,6 +54,7 @@ COMMAND top_operator_list[] = {
COMMAND top_user_list[] = {
{ "help", com_help, "Display this text" },
{ "?", com_help, "Synonym for `help'" },
+ { "server", com_server, "Server commands" },
{ "shell", com_shell, "Activate submenu shell" },
{ "users", com_users, "Activate submenu users" },
{ "quit", com_quit, "Quit using SILA Shell" },
@@ -73,6 +79,7 @@ COMMAND shell_admin_list[] = {
{ "more", com_more, "View the contents of FILE" },
{ "vi", com_vi, "Edit the contents of text FILE" },
{ "poweroff", com_poweroff, "Turn off the BMC power" },
+ { "get_string", cmd_get_string, "GetProperty" },
{ "..", com_top, "Return to top menu" },
{ (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
};
@@ -91,6 +98,7 @@ COMMAND shell_operator_list[] = {
{ "stat", com_stat, "Print out statistics on FILE" },
{ "more", com_more, "View the contents of FILE" },
{ "vi", com_vi, "Edit the contents of text FILE" },
+ { "get_string", cmd_get_string, "GetProperty" },
{ "..", com_top, "Return to top menu" },
{ (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
};
@@ -109,6 +117,7 @@ COMMAND shell_user_list[] = {
{ "stat", com_stat, "Print out statistics on FILE" },
{ "more", com_more, "View the contents of FILE" },
{ "vi", com_vi, "Edit the contents of text FILE" },
+ { "get_string", cmd_get_string, "GetProperty" },
{ "..", com_top, "Return to top menu" },
{ (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
};
@@ -151,6 +160,35 @@ COMMAND users_user_list[] = {
COMMAND_LIST users;
+COMMAND server_admin_list[] = {
+ { "help", com_help, "Display this text" },
+ { "?", com_help, "Synonym for `help'" },
+ { "power", com_power, "Return to top menu" },
+ { "..", com_top, "Return to top menu" },
+ { "quit", com_quit, "Quit using SILA Shell" },
+ { (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
+};
+
+COMMAND server_operator_list[] = {
+ { "help", com_help, "Display this text" },
+ { "?", com_help, "Synonym for `help'" },
+ { "power", com_power, "Return to top menu" },
+ { "..", com_top, "Return to top menu" },
+ { "quit", com_quit, "Quit using SILA Shell" },
+ { (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
+};
+
+COMMAND server_user_list[] = {
+ { "help", com_help, "Display this text" },
+ { "?", com_help, "Synonym for `help'" },
+ { "power", com_power, "Return to top menu" },
+ { "..", com_top, "Return to top menu" },
+ { "quit", com_quit, "Quit using SILA Shell" },
+ { (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
+};
+
+COMMAND_LIST server = {"server", NULL};
+
COMMAND_LIST *current;
@@ -235,24 +273,28 @@ void cmd_lists_init( gid_t gid )
top.name = "top";
shell.name = "shell";
users.name = "users";
+ server.name = "server";
if( privileges == ADMIN || gid == 0 )
{
top.list = &top_admin_list[0];
shell.list = &shell_admin_list[0];
users.list = &users_admin_list[0];
+ server.list = &server_admin_list[0];
}
else if( privileges == OPERATOR )
{
top.list = &top_operator_list[0];
shell.list = &shell_operator_list[0];
users.list = &users_operator_list[0];
+ server.list = &server_operator_list[0];
}
else
{
top.list = &top_user_list[0];
shell.list = &shell_user_list[0];
users.list = &users_user_list[0];
+ server.list = &server_user_list[0];
}
current = &top;