summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index e186215..bef33f5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,6 +20,9 @@
#include <shell.h>
#include <users.h>
+#include <power_commands.h>
+#include <host_commands.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 +34,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 +55,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" },
@@ -151,6 +158,42 @@ 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" },
+ { "restore-policy", com_power_policy, "Set power restore policy" },
+ { "boot", com_boot, "Set host boot options" },
+ { "..", 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, "Run on/off/reset" },
+ { "restore-policy", com_power_policy, "Set power restore policy" },
+ { "boot", com_boot, "Set host boot options" },
+ { "..", 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" },
+ { "restore-policy", com_power_policy, "Set power restore policy" },
+ { "boot", com_boot, "Set host boot options" },
+ { "..", 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 +278,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;