From 661e9ed98480d3bfebf7b572ba1a5a7b5541fca0 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Tue, 8 Sep 2015 22:50:48 -0400 Subject: [PATCH] g2_link admin bugfix --- CONFIGURING | 1 + g2.dvap.cfg | 7 +++++-- g2.everything.cfg | 2 +- g2_link.cpp | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CONFIGURING b/CONFIGURING index d9aacea..de97693 100644 --- a/CONFIGURING +++ b/CONFIGURING @@ -195,6 +195,7 @@ Then the script exec_1.sh will be executed. Two scripts, exec_R.sh and exec_H.sh are included to reboot and halt your system, respectively. Also note that the MYCALL is passed to these scripts\ so you can use this as an input parameter for your scripts. +Only admins can execute scripts so 7) Enabling and disabling INCOMING HotSpotNode connections: diff --git a/g2.dvap.cfg b/g2.dvap.cfg index 265fc63..5670000 100644 --- a/g2.dvap.cfg +++ b/g2.dvap.cfg @@ -1,7 +1,7 @@ # g2_ircddb Configuration for me ircddb = { - login = "MYCALL" + login = "XX0XXX" # If you are not using rr.openquad.net, you need to specify the host and possibly the password. # # host = "some.server.host" // others include group1-irc.ircddb.net @@ -24,6 +24,9 @@ module = { } g2_link = { +# add the callsigns that can shutdown or reboot your system +# admin = [ "XX0XXX" , "YY0YYY" ] // only these users can execute scripts + # link to the reflector of your choice. the first character is the module you are linking. -# link_at_start = "CREF001C" +# link_at_start = "CREF001C" } diff --git a/g2.everything.cfg b/g2.everything.cfg index 9366556..805e5e6 100644 --- a/g2.everything.cfg +++ b/g2.everything.cfg @@ -240,7 +240,7 @@ g2_link = { # link_at_start = "NONE" # Link to a reflector at startup. # to link repeater module B to REF001 C, use "BREF001C" # ref_login = "" # for loging into REF reflectors, if undefined, ircddb.username will be used -# users = [ "CALL1", "CALL2", "CALL3" ] # if defined, only these users can use this gateway +# admin = [ "CALL1", "CALL2", "CALL3" ] # if defined, only these users can execute scripts, block dongles and reload the gwys.txt # link_unlink = [ "CALL4", "CALL5", "CALL6" ] # if defined, only these users can link and unlink a repeater # incoming_ip = "0.0.0.0" # incoming ip address, "0.0.0.0" means accepts all connections. # ip = "127.0.0.1" # where g2_link is running diff --git a/g2_link.cpp b/g2_link.cpp index 5185205..b95d3a0 100644 --- a/g2_link.cpp +++ b/g2_link.cpp @@ -867,7 +867,7 @@ static bool read_config(char *cfgFile) return 1; } - string key = "g2_link.users"; + string key = "g2_link.admin"; only_admin_login = false; if (cfg.exists(key)) { Setting &userlist = cfg.lookup(key); @@ -926,7 +926,7 @@ static bool read_config(char *cfgFile) return 1; } traceit("%s = [ "); - for (link_unlink_user_pos=admin.begin(); link_unlink_user_pos!=admin.end(); link_unlink_user_pos++) + for (link_unlink_user_pos=link_unlink_user.begin(); link_unlink_user_pos!=link_unlink_user.end(); link_unlink_user_pos++) traceit("%s ", link_unlink_user_pos->c_str()); traceit("]\n"); }